Skip to content

Fix RuntimeFromNonWorkerThreads#7746

Merged
alyssawilk merged 5 commits intoenvoyproxy:masterfrom
rgs1:fix-runtimefromnonworkerthreads
Jul 29, 2019
Merged

Fix RuntimeFromNonWorkerThreads#7746
alyssawilk merged 5 commits intoenvoyproxy:masterfrom
rgs1:fix-runtimefromnonworkerthreads

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 rgs@pinterest.com

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 <rgs@pinterest.com>
@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 <rgs@pinterest.com>
Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
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!

* while -> if
* remove unneeded outer scope

Signed-off-by: Raul Gutierrez Segales <rgs@pinterest.com>
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 <rgs@pinterest.com>
@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