Repository navigation
feat(stats): count refused and failed sessions - #5659
Conversation
Co-Authored-By: GPT-6 <noreply@openai.com>
Share fixed session outcome counters across stats tracks, admission and metrics, preserving typed close causes and logical reconnect lifetimes. Co-Authored-By: GPT-6 <noreply@openai.com>
…omes Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
|
Implemented session outcomes and kept this PR a draft. Final committed head is
The implemented taxonomy uses typed causes, counts admission once in the cluster, preserves clean closes, and counts only terminal errors of an established outgoing logical session. Physical reconnect attempts retain their existing separate limitation. The earlier virtual-stream and connection/content-end regressions were fixed and their regressions pass. Recommendation: keep the draft for review and complete current-base full verification plus all-language interop before merge. Suggested follow-ups are reuse of the existing metrics snapshot where registry identity is proven, or a measured presence projection, and a separate lifecycle contract for physical reconnect accounting. No runtime regression was measured for the extra snapshot traversal. (Written by GPT-6) |
…facing rules Add sessions_refused and sessions_failed to the sessions JSON example, cut cluster-dial and setup-error internals from stats.md, and move the sessions_failed /metrics note into the existing /metrics alert list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # quest/m2/wire-stats/README.md
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe change adds typed transport close classifications and session refusal and failure counters. Relay admission and session closure paths record these outcomes, and Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e8a5e7ba0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Main replaced the noq backend with moq-quic, so the noq-gated close classification no longer compiled. Gate it on the quic feature and match moq-tokio's own WebTransport session error. Also tidy Lease::close_session, restore a misplaced test doc comment, and drop a stale driver comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7393469bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Admission starts the stats session, so a SETUP reply that fails before supervision now records its failure kind on the native and io_uring paths. A cluster peer link that gave up reconnecting after it had connected counts as a transport failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
# Conflicts: # quest/m1/README.md # quest/m1/refusal-reason.md
#5689 linked the integration tests into one binary, so the adapter source included by the transport module now resolves crate::quic at main.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review Merged main into (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef8589b8f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Merge summary for
Public API: adds (Written by Claude Opus 5.5) |
# Conflicts: # rs/moq-net/src/ietf/session.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2131c0226
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…first credential A replacement credential can outlive the first credential's expiry, but the lease consumer keeps that first close reason. A later clean close then counted as an expired failure, and hid a real transport failure. A refreshed session now classifies by the reason that ended the session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f347d21ee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A revoked, refused, narrowed, or dropped grant aborts the session, but only an expired one counted. Lease::ended now records the end as expired or application. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1505ddfc7c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A grant that gains an unenforceable cap between admission and SETUP fails Lease::preparing, which returned before the SETUP-reply classification. The admitted session then ended clean. Classify the preparing error the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ed7287d06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Lease::close recorded only an expired revocation, so a refused, invalid, narrowed, or dropped grant that beat a clean peer close ended the session clean. It now records every revocation, and close_session relies on the first recorded kind winning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcccb6e2a6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e454fb8390
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6cc4a7d7a1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…rminal peer link error A refreshed lease's close now polls its union once, so a last credential revoked just before a clean close still fails the session. An established cluster link now counts every terminal error except a refused GOAWAY redirect, which is the peer draining. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e75a0f1096
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The refresh poll in Lease::close took the union's reason but classified it as the session's own close, so a cap the relay could not enforce ended clean. Both paths now share one classifier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-arming after the queue's merge-conflict ejection. Head
(Written by Claude Opus 5.5) |
…tion-log Route #5659's refusal accounting through the shared Lifecycle: cluster admission records its own refusals, and Lifecycle::admit records the LAN and drain refusals for both runtimes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
Admission refusals only reach relay metrics, and session stats cannot distinguish abnormal ends from clean closes. An embedder cannot record a refusal that happens outside relay admission.
Approach
Add fixed, copyable refusal and failure counters to
Presence. Centralize gateway and network admission counting in the cluster, share enabled stats with metrics, and retain a refusal-only collector with one empty-root/default-tier entry when publishing is disabled. Preserve typed transport close causes and classify lease expiry without reading error strings. Native adapters (moq-quic on tokio and io_uring, plus iroh) identify local connection closes as session cancellations, preserving the distinction from clean end-of-content. Generic virtual-streamClosedretains its prior transport fallback.A reconnecting cluster dial keeps its existing logical session: intermediate retries add no failure, and a typed terminal session error counts once after the first connection established.
Impact
stats::Refusal,stats::Failure, their named counter structsstats::Refusalsandstats::Failures,Handle::refuse,Session::fail, andRegistry::is_enabled(re-exported from moq-stats).transport::CloseKind, defaultedtransport::Error::close_kind, andError::IdleTimeout. FFI maps the new variant onto its existingTransporterror, so the binding ABI is unchanged.sessions_refusedandsessions_failedobjects in totals, presence and legacy sessions tracks. Live session counts and existing fields keep their meaning. MoQ protocol wire and codes are unchanged./metricsaddsmoq_relay_sessions_failed_total{tier,kind}.Validation
just checkagainst main passes on the merged head (6,864 Rust tests plus bindings).Follow-ups
expiredrefusal reason remain in the refusal-reason quest.(Written by Claude Opus 5.5)