Skip to content
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

Merged
merged 5 commits into from
Jul 29, 2019

Conversation

rgs1
Copy link
Member

@rgs1 rgs1 commented Jul 28, 2019

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:

  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]

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]>
@rgs1
Copy link
Member Author

rgs1 commented Jul 28, 2019

cc: @alyssawilk

@rgs1
Copy link
Member Author

rgs1 commented Jul 28, 2019

/retest

@repokitteh-read-only
Copy link

🔨 rebuilding ci/circleci: release (failed build)

🐱

Caused by: a #7746 (comment) was created by @rgs1.

see: more, trace.

Raul Gutierrez Segales added 2 commits July 28, 2019 19:59
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]>
Copy link
Contributor

@alyssawilk alyssawilk left a 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!

test/common/runtime/runtime_impl_test.cc Outdated Show resolved Hide resolved
test/common/runtime/runtime_impl_test.cc Show resolved Hide resolved
* while -> if
* remove unneeded outer scope

Signed-off-by: Raul Gutierrez Segales <[email protected]>
Copy link
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@rgs1
Copy link
Member Author

rgs1 commented Jul 29, 2019

/retest

@repokitteh-read-only
Copy link

🐴 hold your horses - no failures detected, yet.

🐱

Caused by: a #7746 (comment) was created by @rgs1.

see: more, trace.

@rgs1
Copy link
Member Author

rgs1 commented Jul 29, 2019

/retest

@repokitteh-read-only
Copy link

🤷‍♀️ nothing to rebuild.

🐱

Caused by: a #7746 (comment) was created by @rgs1.

see: more, trace.

Signed-off-by: Raul Gutierrez Segales <[email protected]>
@alyssawilk alyssawilk merged commit e0552cc into envoyproxy:master Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants