Repository navigation
test: refactor FakeUpstream to avoid use-after-free when scheduling callbacks for a stream that has been terminated due to timeout. - #16590
Merged
antoniovicente merged 2 commits intoMay 24, 2021
Conversation
…vptr when attempting to schedule callbacks for a stream that has been terminated due to timeout. This change doesn't reduce the failure rate or time to detect failures caused by undetected connection disconnects that eventually result in failures due to stream timeout, it just makes the failure condition more clear by avoiding undefined behaviors and crashes in the fake upstream. Signed-off-by: Antonio Vicente <[email protected]>
Contributor
|
Are CI failures real on this one? |
…e upstream. Signed-off-by: Antonio Vicente <[email protected]>
Contributor
Author
There was one more use-after-free that I didn't notice the first time around. Tests are passing after the most recent change. |
alyssawilk
approved these changes
May 24, 2021
| { | ||
| absl::MutexLock lock(&lock_); | ||
| if (saw_reset_) { | ||
| if (!parent_.connected() || saw_reset_) { |
Contributor
There was a problem hiding this comment.
optional: might be worth a helper for this given how many places it shows up.
Contributor
Author
There was a problem hiding this comment.
Yeah, I can see that as a possible improvement to FakeStream::postToConnectionThread. I'll look into it as a possible followup.
antoniovicente
commented
May 24, 2021
antoniovicente
left a comment
Contributor
Author
There was a problem hiding this comment.
Thanks for the review!
| { | ||
| absl::MutexLock lock(&lock_); | ||
| if (saw_reset_) { | ||
| if (!parent_.connected() || saw_reset_) { |
Contributor
Author
There was a problem hiding this comment.
Yeah, I can see that as a possible improvement to FakeStream::postToConnectionThread. I'll look into it as a possible followup.
leyao-daily
pushed a commit
to leyao-daily/envoy
that referenced
this pull request
Sep 30, 2021
…allbacks for a stream that has been terminated due to timeout. (envoyproxy#16590) This change doesn't reduce the failure rate or time to detect failures caused by undetected connection disconnects that eventually result in failures due to stream timeout, it just makes the failure condition more clear by avoiding undefined behaviors and crashes in the fake upstream. Signed-off-by: Antonio Vicente <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message:
test: refactor FakeUpstream to avoid use-after-free and data race on vptr when attempting to schedule callbacks for a stream that has been terminated due to timeout.
This change doesn't reduce the failure rate or time to detect failures caused by undetected connection disconnects that eventually result in failures due to stream timeout, it just makes the failure condition more clear by avoiding undefined behaviors and crashes in the fake upstream.
Risk Level: low (test infrastructure changes)
Testing: existing integration tests
Docs Changes: n/a
Release Notes: n/a
Issue #16493