Repository navigation
fix(sdk): snapshot pending exports during forceFlush - #9005
Open
nikhilred2619 wants to merge 1 commit into
Open
nikhilred2619 wants to merge 1 commit into
nikhilred2619 wants to merge 1 commit into
Conversation
Pull request dashboard statusWaiting on reviewers · refreshed 2026-11-05 14:20 UTC Review the latest changes. Status above doesn't look right?
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9005 +/- ##
=========================================
Coverage 90.37% 90.37%
- Complexity 11012 11013 +1
=========================================
Files 1020 1020
Lines 30119 30119
Branches 3932 3932
=========================================
+ Hits 27219 27220 +1
Misses 1941 1941
+ Partials 959 958 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Fixes #8995
Summary
SimpleLogRecordProcessor.forceFlush()andSimpleSpanProcessor.forceFlush()pass the livependingExportsset toCompletableResultCode.ofAll().Because completed exports are removed concurrently, the set can change between the size calculation and iteration. This can leave the aggregated
forceFlush()result incomplete even after every export has finished.This change:
pendingExportsbefore passing it toCompletableResultCode.ofAll()in both processors.Regression Tests
Added coverage for both log and span processors, including:
forceFlush()with no pending exports.forceFlush()calls after exports complete.forceFlush().shutdown().The concurrency tests exercise bounded races. They do not force the exact problematic interleaving, but verify that the aggregate result is complete once all relevant exports have completed.
Validation
Tested locally on macOS using Eclipse Temurin JDK 25.0.5.
./gradlew :sdk:logs:test :sdk:trace:test— Passed./gradlew :sdk:logs:check :sdk:trace:check— Passedgit diff --check— PassedAll checks completed successfully.