-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fix RuntimeFromNonWorkerThreads #7746
Fix RuntimeFromNonWorkerThreads #7746
Conversation
This is a follow-up to e61681d. While working on envoyproxy#7574, I am getting consistent timeouts for this test. I think it happens because the code on the main thread runs slower than the code on the reader thread. My fix is to properly acquire and release the lock on each step, to ensure they are properly interlaced. That is: 1) read from reader 2) write from writer 3) read new value from reader 4) read new value from writer To repro the timeout, I added a sleep before step 2. After this change, I can't repro anymore. Signed-off-by: Raul Gutierrez Segales <[email protected]>
cc: @alyssawilk |
/retest |
🔨 rebuilding |
This actually ensures that we only wait() if we should. Signed-off-by: Raul Gutierrez Segales <[email protected]>
Signed-off-by: Raul Gutierrez Segales <[email protected]>
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.
Sorry for the flakes, and thanks for the fix. Two minor nits and you're good to go!
* while -> if * remove unneeded outer scope Signed-off-by: Raul Gutierrez Segales <[email protected]>
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.
Awesome, thanks!
/retest |
🐴 hold your horses - no failures detected, yet. |
/retest |
🤷♀️ nothing to rebuild. |
Signed-off-by: Raul Gutierrez Segales <[email protected]>
This is a follow-up to e61681d. While working on #7574, I am getting
consistent timeouts for this test.
I think it happens because the code on the main thread runs slower
than the code on the reader thread.
My fix is to properly acquire and release the lock on each step,
to ensure they are properly sequenced. That is:
To repro the timeout, I added a sleep before step 2. After this change,
I can't repro anymore.
Signed-off-by: Raul Gutierrez Segales [email protected]