Skip to content

fix(metrics): a hard client disconnect no longer counts as a failed operation - #5955

Merged
nicoloboschi merged 2 commits into
mainfrom
fix/disconnect-499-metrics
Oct 22, 2026
Merged

nicoloboschi merged 2 commits into
mainfrom
fix/disconnect-499-metrics

Conversation

@nicoloboschi

Copy link
Copy Markdown
Collaborator

Fixes #5946.

When a client hangs up during sync retain, graph, or recall/reflect work stuck on one await, the outright task-cancel path answered 499 with no typed cause. The metrics classifier only treats a 499 chained to OperationCancelledError as abandoned, so these requests were counted as success=false in hindsight.operation.total.

The 499 is now raised from OperationCancelledError(token.reason), matching the cooperative path. The response is unchanged.

Test: the hard-cancel test now also asserts the 499 is classified as a client cancellation (fails without the fix).

@nicoloboschi
nicoloboschi merged commit 4dec988 into main Oct 22, 2026
117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hard disconnects are counted as failed operations

1 participant