Skip redundant timeout scheduling for completed exports - #1
Open
skrcode wants to merge 1 commit into
Open
Conversation
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.
This is a small JAIPilot follow-up to your exact current PR head
b25a0bbb11c6f4795df05df5399d0aaa38ab4658. It is offered directly to your feature branch so it can become part of open-telemetry#8684; it is not a duplicate upstream PR.What it changes
applyTimeout()now fast-paths an exporter result that is already complete. The current code creates a wrapper result, schedules a timeout, invokes the completion callback synchronously, and immediately cancels that timeout. The fast path preserves the wrapper's observable success/failure state while avoiding that work. Unfinished exports still use the existing timeout path.PeriodicMetricReaderIndependent verification
I reviewed the complete two-file bot diff and repackaged the byte-identical tree as commit
2e09d7ad45731b752265bc5b0ea82e72041abcd5, whose sole parent is your exact head.PeriodicMetricReaderTest— 31 tests, 0 failuresPeriodicMetricReaderTest— 32 tests, 0 failures./gradlew :sdk:metrics:clean :sdk:metrics:build— passed, 161 tasksgit diff --check— passedThe added Mockito test asserts that the scheduler receives zero timeout
schedule(...)calls for a synchronous successful export. The original implementation schedules unconditionally.Scope
This is an operation-count/allocation improvement for exporters that complete synchronously (and for each synchronously completed batch). It is not a blanket wall-clock claim. As in the existing wrapper path, an already-completed exceptional failure is exposed as generic failure, so existing failure behavior is preserved.
Generated by JAIPilot Cloud in skrcode#2, then independently reviewed and rebuilt before this offer.