-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 panic, deadlock and race in BatchSpanProcessor #4353
Merged
Merged
Conversation
This file contains 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
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4353 +/- ##
=======================================
- Coverage 83.5% 83.4% -0.1%
=======================================
Files 184 184
Lines 14383 14374 -9
=======================================
- Hits 12011 11997 -14
- Misses 2145 2149 +4
- Partials 227 228 +1
|
pellared
changed the title
Fix races in BatchSpanProcessor
Fix deadlock and race in BatchSpanProcessor
Jul 24, 2023
pellared
requested review from
MrAlias,
Aneurysm9,
evantorrie,
XSAM,
dashpole,
MadVikingGod,
hanyuancheung and
dmathieu
as code owners
July 24, 2023 12:04
FYI @peolivei2 |
pellared
commented
Jul 24, 2023
dashpole
reviewed
Jul 24, 2023
dashpole
approved these changes
Jul 24, 2023
pellared
commented
Jul 24, 2023
Co-authored-by: David Ashpole <dashpole@google.com>
pellared
changed the title
Fix deadlock and race in BatchSpanProcessor
Fix panic, deadlock and race in BatchSpanProcessor
Jul 24, 2023
dmathieu
approved these changes
Jul 25, 2023
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.
Fixes #4249
Fixes #4335
Test result of
TestBatchSpanProcessorConcurrentSafe
test executed onmain
(without the fixes):As you can see
ForceFlush
was is not properly synchronized and there is a possible deadlock (sic!).Here is the test result (notice the test count is 100 times bigger) after the fixes are applied:
Here is the test result when I only cherry-pick 68e62aa on
main
(it contains a hotfix for the deadlock, but the race condition is still in place). It proves that the PR fixes #4249.It may be good to revisit the synchronization implementation, but I would rather do it as a separate PR. However, I think that current implementation is good enough for now. I created #4354