Repository navigation
Marvin: escalating backoff and durable deferred recovery - #15
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc5dae1337
ℹ️ 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".
| LastResponseAt = now; ResponsiveReplies = Math.Min(3, ResponsiveReplies + 1); | ||
| if (outcome.Length == 0) { MatchedReplies = Math.Min(3, MatchedReplies + 1); LastMatchAt = now; } |
There was a problem hiding this comment.
Exclude in-flight batch replies from recovery probes
When a catch-up batch has already dispatched many lookups, three errors can open the circuit while later successful completions from that same batch still increment these counters during PausedUntil. As soon as the pause expires, RecoveryReady is therefore already true and the next pass can dispatch the full parallel batch instead of performing one post-pause probe per pass. Ignore pre-pause completions or count only explicitly dispatched recovery probes.
AGENTS.md reference: AGENTS.md:L13-L14
Useful? React with 👍 / 👎.
| // An in-flight batch may finish after the circuit opens. It must not | ||
| // advance the ladder 64 times or move the pause on every completion. | ||
| if (Paused(now)) return; | ||
| if (++ConsecutiveErrors >= 3 || outcome is "http_429" or "provider_configuration") |
There was a problem hiding this comment.
Catch the rate-limit exception emitted by the client
On an actual HTTP 429, GetRawStringAsync throws AioStreamsRateLimitException before ImportInventory.ResolveCoreAsync reaches its LastHttpStatus == 429 conversion to ImportHttpRateLimitException. The reconciliation worker catches only the latter and maps the former through its generic handler to transport_failure, so this new immediate-open http_429 path is unreachable for production requests and the dashboard also misclassifies them. Catch or translate the exception that AioStreamsClient actually emits.
AGENTS.md reference: AGENTS.md:L13-L14
Useful? React with 👍 / 👎.
When source lookups fail repeatedly, Marvin now backs off each movie/episode on an escalating ladder and opens a persistent maintenance circuit for transport failures. Administrators can queue one durable pass over eligible deferred failures; that pass probes conservatively until recent responsive replies include a source match, then uses the existing work budget. Files, identities, removals, leases and attempt history remain protected.
Maintenance sends once with aligned cancellation/deadlines instead of racing repeated HTTP requests. Due work precedes the observation cursor, recent valid saved-file observations are reused, and checkpoints batch local writes. The native dashboard separates actual AIO HTTP submissions/retries from logical attempts and exposes circuit/recovery state. Version:0.42.12.
Validation:228/228 regression tests and the required pinned Emby4.10.0.40 ABI build passed; repository hygiene check passed. Coverage includes restart persistence, escalating failures, bounded recovery probes, cancellation checkpoints, superseded queues and preserved ownership/identity/file guards. Production deployment and sustained throughput/playback verification remain separate.