Skip to content

chore: Support rusqlite 0.39.x#425

Merged
jxs merged 2 commits intorust-db:mainfrom
tomasol:pr-rusqlite-39
Apr 24, 2026
Merged

chore: Support rusqlite 0.39.x#425
jxs merged 2 commits intorust-db:mainfrom
tomasol:pr-rusqlite-39

Conversation

@tomasol
Copy link
Copy Markdown
Contributor

@tomasol tomasol commented Apr 22, 2026

No description provided.

utof added a commit to utof/perima that referenced this pull request Apr 23, 2026
GH #131 documents an AB-BA lock-order inversion in SQLite's unixClose
vs unixLock-from-sqlite3WalClose code paths. Per upstream forum
https://sqlite.org/forum/info/a820be408ae265adb0de2b740633b179b2256420c1bb050fc9095566b18255b4
the bug was introduced in SQLite 3.51.0 (2025-11-04) by the new
unixIsSharingShmNode broken-POSIX-lock detection logic, which took
unixBigLock inside a scope already holding pInode->pLockMutex —
violating SQLite's own documented lock-order invariant. Reported
2025-12-05, patched same day, shipped in SQLite 3.51.2 (2026-01-09).
Release notes: https://sqlite.org/releaselog/3_51_2.html — "Fix an
obscure deadlock in the new broken-posix-lock detection logic."

rusqlite 0.38's bundled feature vendors SQLite 3.51.1 — the buggy
window. rusqlite 0.39 vendors SQLite 3.51.3 with the fix.

Workspace deps bumped:
- rusqlite       0.38 → 0.39
- r2d2_sqlite    0.32 → 0.33  (rusqlite 0.39 transitively requires
                                libsqlite3-sys 0.37; r2d2_sqlite 0.32
                                pinned 0.36 via rusqlite 0.38 →
                                links="sqlite3" conflict; 0.33 fixes)
- refinery       0.9.1 → 0.9  (relax requirement; PR branch is 0.9.0)
- libsqlite3-sys 0.36 → 0.37  (transitive via rusqlite 0.39)

[patch.crates-io] entry temporarily pins refinery + refinery-core to
the open PR rust-db/refinery#425 branch which
widens refinery's rusqlite cap from `<=0.38` to `<=0.39`. PR is
mergeable + all upstream CI green; awaiting maintainer merge. Patch
removal tracked in a separate follow-up issue (filed alongside this
commit).

Local verification (5 sequential `cargo nextest run -p perima-db`
runs, default parallelism, no retries):
  Pre-bump:  ~20% hang rate, 80s+ deadlocked test processes
  Post-bump: 5/5 PASS in ~8s each, 0 hangs.

Workarounds added in earlier commits on this branch (nextest retries=2
for perima-db, #[ignore] on 7 desktop _inner tests, slow-timeout
override for perima-desktop) are now logically dead code. They will be
reverted in a follow-up commit once CI confirms this fix.
Copy link
Copy Markdown
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

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

Thanks!

@jxs jxs merged commit f4b23ea into rust-db:main Apr 24, 2026
29 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.

2 participants