fix: close database handles after failed open - #2
Open
marcus-pousette wants to merge 1 commit into
Open
Conversation
marcus-pousette
changed the base branch from
master
to
codex/ci-sqlite-fetch-fallback
July 14, 2026 20:28
marcus-pousette
force-pushed
the
fix/close-failed-open-handle
branch
from
July 14, 2026 20:28
8d8e3c2 to
3e5d255
Compare
marcus-pousette
force-pushed
the
codex/ci-sqlite-fetch-fallback
branch
from
July 15, 2026 06:34
3b3fe0c to
5429cdb
Compare
marcus-pousette
force-pushed
the
fix/close-failed-open-handle
branch
from
July 15, 2026 06:34
3e5d255 to
2655c59
Compare
This was referenced Jul 15, 2026
marcus-pousette
changed the base branch from
codex/ci-sqlite-fetch-fallback
to
sync/upstream-1.1.1
July 15, 2026 07:56
marcus-pousette
force-pushed
the
fix/close-failed-open-handle
branch
from
July 15, 2026 07:56
2655c59 to
d7a1e3c
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.
Why
SQLite can return a database handle even when
sqlite3_open_v2fails, and requires callers to close it. The wrapper currently tracks that failed handle and throws before callers can release it, potentially leaving OPFS resources or locks alive. It also registers extension functions before confirming that the open succeeded.SQLite documents the failed-open cleanup requirement in
sqlite3_open_v2.What changes
Merge order
This PR is based on the upstream 1.1.1 sync in #4. Merge #4 first, retarget this PR to
master, then use Create a merge commit. TreeCRDT #210 pins this exact head, so it must remain reachable from the default branch.