Repository navigation
feat(storage): record HTTP ReadObject stall.duration on SocketTimeoutException - #15232
Open
nidhiii-27 wants to merge 10 commits into
Open
nidhiii-27 wants to merge 10 commits into
nidhiii-27 wants to merge 10 commits into
Conversation
…Exception Record Debug-tier gcp.storage.client.stall.duration (unit "s", exact 8-key attributes with rpc.method=google.storage.v2.Storage/ReadObject and network.path=cloudpath) on HTTP ReadObject SocketTimeoutException failures across initial open attempts and mid-stream socket reads while excluding non-timeout errors, non-ReadObject operations, and inter-read application processing time. [Generated-by: AI]
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces tracking and recording of HTTP read stall durations during ReadObject operations when a socket timeout occurs. It adds activity tracking to StorageMetricsContext and ApiaryUnbufferedReadableByteChannel to measure the time elapsed since the last progress. Feedback on the changes suggests addressing a potential double-recording of the stall duration during a terminal failure to open a stream by ensuring mid-stream stalls are only recorded when the channel is not null.
…age-http-stall-duration-metric [Generated-by: AI]
…age-http-stall-duration-metric [Generated-by: AI]
…age-http-stall-duration-metric [Generated-by: AI]
…age-http-stall-duration-metric [Generated-by: AI]
recordAttemptFailure(String, long) passes no Throwable for google-http-client internal retries. [Generated-by: AI]
nidhiii-27
marked this pull request as ready for review
November 26, 2026 06:05
nidhiii-27
requested review from
Dhriti07 and
cpriti-os
and removed request for
a team
November 26, 2026 06:05
cpriti-os
requested changes
Nov 26, 2026
…est for Java 8 compatibility Replace Mockito.mock(StreamController.class) with TestUtils.nullStreamController() in stubMidStreamReadFailure to avoid ByteBuddy JDK 8 failures when copying JSpecify @NullMarked annotations from StreamController. [Generated-by: AI]
…age-http-stall-duration-metric
- Track streaming write activity in StorageImpl.downloadTo and HttpStorageRpc.load/read - Read lastActivityNanos before clock.nanoTime() and clamp elapsedNanos >= 0 - Early-return in markActivity() when stall metrics disabled and reuse in incrementAttempts() - Reuse retryIf in ApiaryUnbufferedReadableByteChannelTest and fakeClock in StorageMetricsContextTest - Add unit tests for downloadTo/readAllBytes mid-stream SocketTimeoutException and clock skew clamping
Merge commit cdca421 from feat/storage-grpc-veneer-operation-metrics to replace Mockito.mock(StreamController.class) with TestUtils.nullStreamController() in GrpcStorageImplTest, resolving split-units (java-storage, 8) failures caused by JSpecify @NullMarked on StreamController under JDK 8. [Generated-by: AI]
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.
Summary
Stacked on #15231.
Adds HTTP/JSON
ReadObjectstall detection for Debug-tiergcp.storage.client.stall.duration(DoubleHistogram, units) onSocketTimeoutExceptionfailures across both initial open attempts and mid-stream socket reads.Changes
StorageErrorTypeMapper: add cycle-safe, depth-boundedhasSocketTimeoutCause(Throwable)helper.StorageMetricsContext: tracklastActivityNanos, addmarkActivity(), and addrecordHttpReadStallIfTimeout(Throwable)emittinggcp.storage.client.stall.durationwith exact 8-key attributes (gcp.storage.operation = "ReadObject",rpc.method = "google.storage.v2.Storage/ReadObject",network.path = "cloudpath") exclusively for HTTPReadObjectSocketTimeoutExceptionfailures.ApiaryUnbufferedReadableByteChannel: callmarkMetricsActivity()immediately beforesbc.read(...)(so inter-read application processing time does not inflate stall duration) and invokerecordHttpReadStall(t)incatch.StorageErrorTypeMapperTest,StorageMetricsContextTest, andApiaryUnbufferedReadableByteChannelTest.[Generated-by: AI]