sqlite: prevent database close during callbacks#64743
Open
mcollina wants to merge 1 commit into
Open
Conversation
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64743 +/- ##
==========================================
- Coverage 92.01% 90.15% -1.87%
==========================================
Files 379 744 +365
Lines 166972 242541 +75569
Branches 25554 45697 +20143
==========================================
+ Hits 153639 218659 +65020
- Misses 13041 15370 +2329
- Partials 292 8512 +8220
🚀 New features to boost your workflow:
|
mcollina
force-pushed
the
fix-sqlite-close-during-callback
branch
from
July 26, 2026 06:51
4798627 to
d3160fe
Compare
Co-authored-by: Asroy Cristian Sitorus <asroycristiansitorus@gmail.com> Signed-off-by: Matteo Collina <hello@matteocollina.com>
mcollina
force-pushed
the
fix-sqlite-close-during-callback
branch
from
July 26, 2026 07:31
d3160fe to
822fbef
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.
Prevent
DatabaseSync.close()from finalizing SQLite resources while a JavaScript callback is executing.SQLite invokes user-defined functions, aggregate functions, authorizers, and changeset callbacks synchronously during database operations. Previously, calling
database.close()from one of these callbacks could finalize active statements or the connection while native code was still using them.This change tracks callback depth and rejects reentrant closes with
ERR_INVALID_STATE. It also adds regression coverage forStatementSync.all(),get(),run(), anditerate().