Skip to content

fix(sessions): clear stale corrupt-history backoff after recovery - #4726

Closed
ScriptedAlchemy wants to merge 3 commits into
masterfrom
fix/4569-reset-blocker-backoff-after-recovery
Closed

ScriptedAlchemy wants to merge 3 commits into
masterfrom
fix/4569-reset-blocker-backoff-after-recovery

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Root cause

Refs #4569 (partial scheduler recovery correctness).

The worker already backs off a terminal Blocked historical-ingest result. However, it cleared the old retry escalation only when the next nonblocked pass had history_requires_projection, i.e. made progress or returned Complete. A legitimately recovered Pending { made_progress: false } or Retryable { made_progress: false } result left the old terminal attempt count intact. If a subsequent independent corruption appears, its first refusal can inherit the earlier long delay instead of starting at the normal one-minute floor.

Change

  • Clear terminal backoff only when the existing typed HistoryRelease::Capacity proves an ingestor pass ran and its result is nonblocked (Complete, Pending, Retryable), independent of source-row progress. A synthetic history_admission_saturated Retryable keeps the previous escalation.
  • Never clear on an idle/suppressed wake (None) or a Blocked result, including when healthy sibling providers committed rows. Cancellation still stops the worker before reset.
  • Leave the existing exponential 1-minute–1-hour schedule, limits, historical admission, storage recovery, and status contracts untouched.

One owning worker file changes. The unit regression distinguishes admitted outcomes at zero and positive progress, cancellation and suppressed wakes, and admission refusal after a previous corrupt-store blocker. No runtime or Bazel pass is claimed.

Verification

Reviewed the current master worker and historical outcome enum, its cancellation and projection paths, the relevant outstanding history-blocker PR (#4715), and this exact one-commit GitHub diff. The branch was pushed non-force from master at 16f436862d9d5cda5c8faf9e532b6f4cc15c4842 with an expected-head update. Only the worker file changes; no integrity gate or assertion was weakened.

Bazel, Rust compilation, rustfmt, and the added regression were not executed: this execution environment has no supplied checkout or Bazel/Rust toolchain. Hosted CI must compile and execute the session-temporal-runtime unit test and broader refresh journeys on this isolated head before merge. Source review is not a test pass.

Remaining #4569 scope

This does not implement the missing verified relational sessions.db rebuild protocol, prove recovery of the reported 1.6-GB corrupt store, or complete status/Doctor visibility and restart behavior. Keep #4569 open. The existing PR-repair/merge automation owns hosted CI follow-through and authorized merging.


Devin Review

Clear the previous terminal retry escalation when an admitted history pass
is no longer Blocked, even if it commits no new source rows. A suppressed
wake and a Blocked result with healthy-sibling progress still cannot
clear a corrupt provider's backoff.

Add a regression covering pending/retryable zero-progress recovery and
the blocked, cancelled and suppressed cases.

Refs #4569.
@changeset-bot

changeset-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 075beb9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

Use the existing typed HistoryRelease authority to distinguish an admitted
history pass from synthetic retryable admission saturation. A denied permit
cannot prove a blocked provider has recovered. Extend the existing outcome
regressions with actual admission and no-progress distinctions.
Apply the exact rustfmt_check_2024 output to the existing assertions.
Preserve behavior and keep the history-backoff regression intact.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Consolidated into #4742 (integrate/open-pull-requests) at the captured head shown in its description, as requested. Continue review and further fixes on #4742. This closure does not assert CI readiness; the replacement remains draft. Source branch retained.

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