fix(metadata): bound Audnexus HTTP requests to a 10s timeout#745
Draft
kevinheneveld wants to merge 1 commit into
Draft
fix(metadata): bound Audnexus HTTP requests to a 10s timeout#745kevinheneveld wants to merge 1 commit into
kevinheneveld wants to merge 1 commit into
Conversation
Audnexus calls had no per-request timeout and relied on the default 100s HttpClient.Timeout, and every catch in AudnexusService excluded OperationCanceledException, so a slow/unresponsive Audnexus response hung for the full 100 seconds and then surfaced as an uncaught TaskCanceledException instead of failing gracefully. Mirrors AudibleApiClient's existing pattern: a locally-scoped CancellationTokenSource per request, with TaskCanceledException caught and logged as a warning that returns null so callers fall through to their normal "not found" handling.
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
HttpClient.TimeoutcatchinAudnexusServiceexcludedOperationCanceledException, so a slow/unresponsive Audnexus response hung ~100s and then surfaced as an uncaughtTaskCanceledExceptioninstead of a graceful "not found"AudibleApiClient's existing pattern: a locally-scopedCancellationTokenSourceper request (10s), withTaskCanceledExceptioncaught and logged as a warning that returnsnullso callers fall through to normal not-found handlingTest plan
dotnet build— cleandotnet test— 1467/1467 passingDraft per PR-pacing convention (several PRs already active); will promote when a slot frees up.