fix(state): retry transient SQLite WAL setup failures (Fixes #30576)#30700
Open
deepujain wants to merge 1 commit into
Open
fix(state): retry transient SQLite WAL setup failures (Fixes #30576)#30700deepujain wants to merge 1 commit into
deepujain wants to merge 1 commit into
Conversation
This was referenced May 24, 2026
Author
|
@teknium1 Updated this PR against current main and resolved the WAL/state conflicts. The branch now keeps current main’s read-only WAL probe and disk I/O re-raise behavior, while adding bounded retry only for transient SQLite busy/locked WAL setup errors. GitHub now reports the PR as mergeable. Focused validation: |
bc2d1e9 to
73041de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #30576.
SessionDBopens its connection.Why
The state database already retries write transactions after SQLite returns busy or locked errors. The connection itself still used a 1 second busy timeout, though, and WAL setup handled some transient failures as immediate fallback or hard failure.
On BTRFS with CoW, those short-lived WAL setup failures can clear on retry. Retrying the idempotent
PRAGMA journal_mode=WALpath gives SQLite a chance to settle without broad changes to durability policy.Overlap Check
Before changing code, I checked issue #30576 and
gh search prsfor #30576, SQLite WAL, BTRFS, busy_timeout, retry, and state DB lock wording. I found adjacent open WAL maintenance/corruption PRs (#30654, #16510, #30011, #24033), but none covering this busy-timeout plus WAL setup retry path. This PR avoids their checkpoint, synchronous, and doctor changes.Validation
scripts/run_tests.sh tests/test_hermes_state.py tests/test_hermes_state_wal_fallback.py- 232 tests passed, 0 faileduv tool run ruff check hermes_state.py tests/test_hermes_state.py tests/test_hermes_state_wal_fallback.py- all checks passedgit diff --check- clean