-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
pkg/cacheutil: Async op fix #8044
Conversation
The existing implementation sometimes drops existing operations that are still on the queue when .stop() is called. If multiple communications in a select statement can proceed, one is chosen pseudo-randomly: https://go.dev/ref/spec#Select_statements This means that sometimes a processor worker will process a remaining operation, and sometimes it won't. Signed-off-by: Daniel Sabsay <[email protected]>
Signed-off-by: Daniel Sabsay <[email protected]>
For context, the result of this bug is flaky tests: cortexproject/cortex#6480 |
@@ -0,0 +1,33 @@ | |||
package cacheutil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are missing a header here, please add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Signed-off-by: Daniel Sabsay <[email protected]>
@GiedriusS I think this is ready now. Please take a look when you have a chance. |
Changes
This fixes the test in #8043. That separate PR was only to show that the test fails in CI.
The existing implementation sometimes drops existing operations that are
still on the queue when .stop() is called.
If multiple communications in a select statement can proceed, one is
chosen pseudo-randomly: https://go.dev/ref/spec#Select_statements
This means that sometimes a processor worker will process a remaining
operation, and sometimes it won't.
Verification
I ran the test multiple times locally, switching between the old implementation of
asyncQueueProcessLoop()
and this new one.Additionally, #8043 shows that the new test fails in CI with the old implementation.