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: Fix fake_upstream for tsan
Additional Description: Based on the traces in #34644 my understanding is that the lambda given to
postToConnectionThread
reads from the header object sometimes before and sometimes after the main thread 'deletes' the shared_ptr. I think this is actually tsan being incorrect, because either way the race goes, the shared_ptr is always deleted after the read, but it also is unnecessary to have the race because the main thread doesn't use the object after posting it, so posting it by move should resolve the problem.I wasn't able to test this fix myself because some part of the test command in standard vscode dev container was unhappy and just failed the test at startup every time with or without this change, saying
FATAL: ThreadSanitizer: unexpected memory mapping 0x74ee2ec72000-0x74ee2f100000
. Even if this doesn't fix it it's still an improvement.Risk Level: None
Testing: Yes it is
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a
Fixes #34644