Skip to content

fix: prevent truncated rollout mid-file on shutdown recovery - #201

Merged
wangtsiao merged 1 commit into
7df-lab:mainfrom
wangtsiao:fix/shutdown-rollout-truncated-race
Sep 8, 2026
Merged

wangtsiao merged 1 commit into
7df-lab:mainfrom
wangtsiao:fix/shutdown-rollout-truncated-race

Conversation

@wangtsiao

Copy link
Copy Markdown
Contributor

Summary

  • Cancel + abort the active turn before writing recovery / terminal lines during shutdown, so concurrent journal writes cannot leave a truncated JSONL row behind later shutdown facts.
  • When hydrating for append, discard trailing crash-tail bytes; loaders also treat truncated lines followed only by blanks as a final crash tail.
  • Stabilize queue_drains_after_restart_when_session_idle by dropping the runtime before unblocking the gated provider.

Test plan

  • cargo test -p devo-server --lib queue_drains_after_restart_when_session_idle
  • cargo test -p devo-server --lib hydration_tolerates_truncated
  • cargo test -p devo-server --lib load_tolerates_truncated_crash_tail
  • CI green

Cancel/abort the active turn before persisting recovery on shutdown, trim
crash-tail bytes before append, and treat truncated+blank JSONL as final so
restart hydration no longer fails closed on the queue-drain race.

Co-authored-by: Cursor <cursoragent@cursor.com>
@wangtsiao
wangtsiao merged commit ce8f900 into 7df-lab:main Sep 8, 2026
5 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.

1 participant