Skip to content

fix: recover orphaned ledger locks after host crashes - #55

Merged
cloader merged 2 commits into
mainfrom
codex/fix-53-ledger-recovery
Oct 21, 2026
Merged

cloader merged 2 commits into
mainfrom
codex/fix-53-ledger-recovery

Conversation

@cloader

@cloader cloader commented Oct 21, 2026

Copy link
Copy Markdown
Owner

A freshly orphaned ledger lock previously timed out after 30 seconds, before its five-minute stale window, causing repeated restart failures (#53).

This change recovers locks owned by exited processes immediately, preserves live or indeterminate owners, and uses unique owner records inside a lock directory so competing reclaimers cannot delete a replacement owner's record. Legacy lock files remain supported. Clean startup skips write-lock acquisition; startup reconciliation failures are handled without discarding the ledger.

Validation: typecheck and build passed; all 517 tests passed, including a killed host and four independent writers recovering an orphan. This PR contains only the #53 recovery changes; #54 is handled separately.

Fixes #53

@cloader
cloader merged commit 0549245 into main Oct 21, 2026
1 check passed
@cloader
cloader deleted the codex/fix-53-ledger-recovery branch October 25, 2026 11:13
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.

[Bug] 崩溃后重启失败:台账锁超时(30s)短于僵死判定(5min),导致致命加载失败

1 participant