-
Notifications
You must be signed in to change notification settings - Fork 986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flaky test pingNotAllowedInSubscriptionState #2322
Comments
Is this issue still relevant? |
Hi @tishun, Is this a question for me? I'll need to read the description again(I probably already forgot)and check the lettuce code to see if there have been any changes. If you're one of the maintainers, I'd appreciate it if you could handle that. I'll try to look into it if I get some free time next week, but I can't make any promises. In our test suite (which includes a copy of your test suite) against our Redis implementation, we decided to skip that test and moved on. |
Hey, sorry for not addressing you directly, yes, it was meant for you.
Trying to wrap my head around this. What you are saying is that there is some delay between the time you subscribe to a channel and the time the logic that disables sending commands kicks in. As a result sometimes you would get the RedisException and some times you wont. Is that mostly correct? |
Yes, it sounds correct. If the codebase is still same, |
Well since your report quite some things have changed in the code including the test case itself. I suggest that you try and update your code with the latest changes and see if you have issues with them. |
Ok, thanks for the update. We will do so. |
Let's close this for now, if you experience any more issues please reopen |
Bug Report
Current Behavior
Test
pingNotAllowedInSubscriptionState
fails randomly in our tests against Upstash Redis. After investigating if our implementation of Redis has a problem, we have concluded that the problem in lettuce side.Test failure happens in the following assertion
Cause Of the Problem
The test fails because of a race condition between two threads. More specifically:
The future for subscribe is completed after we are updating the internal state of PubsubEndpoint(adding a new channel to the channels set). Because of that, in some unlucky timing, the test (PubSubCommandHandler#notifyPushListeners) fails.
Possible Solution
Remove local checks for allowed commands and rely on the exception from redis.This way, we can both remove the bug and simplify the library.More details in pr that I have prepared for the proposed solution:#2314This solution is eliminated because the local checks are needed see #579
The text was updated successfully, but these errors were encountered: