RUM-790 Fix PendingTrace ConcurrentModificationException#1623
Merged
Conversation
xgouchet
force-pushed
the
xgouchet/RUM-790/pending_trace
branch
from
September 19, 2023 11:50
81b4e13 to
bbfb51e
Compare
0xnm
reviewed
Sep 19, 2023
jonathanmos
reviewed
Sep 19, 2023
| } else { | ||
| if (!isWritten.get()) { | ||
| addFirst(span); | ||
| } else { |
Member
There was a problem hiding this comment.
is the empty else block intentional?
jonathanmos
reviewed
Sep 19, 2023
| countDownLatch.await(20, TimeUnit.SECONDS) | ||
|
|
||
| // Then | ||
| assertThat(countDownLatch.count).isZero() |
Member
There was a problem hiding this comment.
Do we need this assertion? Doesn't countdownlatch.await block until timeout or reaching a count of zero?
Contributor
Author
There was a problem hiding this comment.
Yes we do, in case the await reaches timeout.
Codecov Report
@@ Coverage Diff @@
## develop #1623 +/- ##
===========================================
+ Coverage 83.57% 83.73% +0.16%
===========================================
Files 452 452
Lines 15652 15656 +4
Branches 2324 2323 -1
===========================================
+ Hits 13081 13109 +28
+ Misses 1950 1932 -18
+ Partials 621 615 -6
|
jonathanmos
reviewed
Sep 19, 2023
| if (span.getDurationNano() == 0) { | ||
| return; | ||
| } | ||
| if (traceId == null || span.context() == null) { |
Member
There was a problem hiding this comment.
I'm assuming that the reason all fail fast conditionals are separated is so that we can figure out exactly which one caused the problem in a stacktrace. If so, perhaps we should split this one also?
0xnm
approved these changes
Sep 19, 2023
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.
What does this PR do?
Add some thread safe guards for PendingTrace, and prevent
ConcurrentModificationException.Additional Notes
Fixes #1570
Review checklist (to be filled by reviewers)