Record HTTP status code on blob-hydration failure telemetry - #2085
Merged
tyrielv merged 1 commit intoAug 14, 2026
Conversation
When an on-demand loose-blob download fails, GVFS emits a terminal telemetry error with a BlobHydrationFailureCategory. The DownloadFailed category is the transient or unclassified bucket. It collapses genuine auth failures (401, 400, 302) and transient failures (timeout 408, 5xx, pool-exhaustion 503) into one value. The HTTP status of the failing download is known in the code, but it only reaches the on-box log, not shipped telemetry. So telemetry cannot tell a real auth failure apart from a transient one. Carry the HTTP status of the last download attempt to the terminal failure event through an internal DownloadAttemptResult type. Add HttpStatusCode and HttpStatusName to the event metadata only when the failure is attributable to the download itself (DownloadFailed or ObjectNotOnServer), so an earlier attempt's status cannot attach to a later local-IO or copy failure. The public TryDownloadAndSaveObject return type does not change. Assisted-by: Claude Opus 4.8 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
tyrielv
force-pushed
the
tyrielv/blob-hydration-telemetry
branch
from
August 13, 2026 17:08
a90a1d0 to
64b0dbe
Compare
tyrielv
marked this pull request as ready for review
August 13, 2026 20:49
tyrielv
enabled auto-merge
August 13, 2026 20:50
Keith Klein (KeithIsSleeping)
approved these changes
Aug 14, 2026
Open
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.
Problem
When an on-demand loose-blob download fails, GVFS emits a terminal telemetry error
TryCopyBlobContentStream: Failed to provide blob contentstagged with aBlobHydrationFailureCategory. TheDownloadFailedcategory is the transient/unclassified bucket, so it collapses both genuine auth failures (HTTP 401/400/302) and transient failures (timeout 408, 5xx, connection-pool-exhaustion 503) into one value.The HTTP status of the failing download is already known inside the code, but it is only written to the on-box GVFS log (an Informational event that is not shipped). It never reaches shipped telemetry. As a result, you cannot tell from telemetry whether blob failures were real 401s or transient failures.
Change
Carry the HTTP status of the last download attempt through to the point where the terminal failure telemetry is emitted, and add it to that event's metadata:
DownloadAttemptResulttype carries both the existingDownloadAndSaveObjectResultoutcome and theHttpStatusCode?of the last attempt.DoDownloadAndSaveObjectand the private coalescingTryDownloadAndSaveObjectnow return the richer type; theinflightDownloadscoalescing dictionary holdsLazy<DownloadAttemptResult>.DownloadAndSaveObjectResult TryDownloadAndSaveObject(...)overload is unchanged, so callers inInProcessMountandGVFSVerbare unaffected.OnFailurehandler addsHttpStatusCode(int) andHttpStatusName(string) to the event metadata only when the failure is attributable to the download itself (categoryDownloadFailedorObjectNotOnServer). On the exception (LocalIO/NetworkUnavailable) andLocalCopyFailedpaths the status is suppressed, so an earlier attempt's status cannot attach to a later, differently-caused terminal event. When no HTTP response was received (exhausted-retry exception, or a failure carrying no status), no status keys are emitted. ExistingBlobHydrationFailureCategorybucketing is preserved and the new keys are purely additive.No credential/auth logic,
HttpRequestor, orRetryWrapperbehavior changes.Tests
GVFSGitObjectsTests(23/23 pass):Unauthorizedproduces a terminal event containing"HttpStatusCode":401/"HttpStatusName":"Unauthorized", still bucketedDownloadFailed.ServiceUnavailableproduces"HttpStatusCode":503/"HttpStatusName":"ServiceUnavailable"— directly exercising the auth-vs-transient split.HttpStatusCode/HttpStatusNamekeys (guards against ever emitting"HttpStatusCode":0).