Skip to content

Marvin: escalating backoff and durable deferred recovery - #15

Merged
OneHotTake merged 1 commit into
mainfrom
fix/maintenance-backoff-recovery
Oct 1, 2026
Merged

OneHotTake merged 1 commit into
mainfrom
fix/maintenance-backoff-recovery

Conversation

@OneHotTake

Copy link
Copy Markdown
Owner

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T15:27:57.681363Z cc5dae1 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +27 to +28
LastResponseAt = now; ResponsiveReplies = Math.Min(3, ResponsiveReplies + 1);
if (outcome.Length == 0) { MatchedReplies = Math.Min(3, MatchedReplies + 1); LastMatchAt = now; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@OneHotTake
OneHotTake merged commit e67d85e into main Oct 1, 2026
2 checks passed
@OneHotTake
OneHotTake deleted the fix/maintenance-backoff-recovery branch October 1, 2026 15:28
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.

1 participant