Repository navigation
Isolate S3 CRT metric publishers from event loop - #7422
Open
jencymaryjoseph wants to merge 1 commit into
Open
jencymaryjoseph wants to merge 1 commit into
jencymaryjoseph wants to merge 1 commit into
Conversation
jencymaryjoseph
force-pushed
the
jencyjos/s3-crt-metric-publisher-isolation
branch
from
October 2, 2026 18:04
e78ec3e to
a96f3d6
Compare
jencymaryjoseph
force-pushed
the
jencyjos/s3-crt-metric-publisher-isolation
branch
from
October 14, 2026 05:31
a96f3d6 to
5790f46
Compare
jencymaryjoseph
marked this pull request as ready for review
October 14, 2026 18:47
|
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Motivation and context
S3CrtResponseHandlerAdapter.onTelemetrycurrently invokes customer-provided metric publishers on a CRT native callback thread. A slow or blocking publisher can therefore delay CRT event-loop processing and affect S3 request progress.Modifications
CRT telemetry values are copied into an SDK MetricCollection while the callback is active, and publisher invocation is then moved to a client-scoped asynchronous dispatcher. The dispatcher uses one daemon worker and a bounded FIFO queue of 128 collections. This keeps publisher code off CRT callback threads, preserves collection acceptance order, and bounds memory usage. If publishers cannot keep up and the queue becomes full, new metric collections are dropped and a and warnings are logged at increasing drop-count thresholds to avoid log flooding.
The dispatcher follows the same general bounded single-worker queue pattern used by
CloudWatchMetricPublisher, including the default queue capacity of 128. Its shutdown and drop-accounting behavior is specific to S3 CRT.S3CrtMetricPublisherDispatcherwith a single bounded queue and worker per S3 CRT client.Testing
Added unit tests covering callback-thread isolation, daemon execution, ordering, blocking publishers, bounded-queue drops, publisher exceptions, graceful and timed-out shutdown, asynchronous close, and post-close submissions.
Performance benchmarks are currently running. Will update once done.
Types of changes
Checklist
mvn installsucceedsLaunchChangelogLicense