Repository navigation
Add util to close db connections - #8626
Merged
Jens Hedegaard Nielsen (jenshnielsen) merged 5 commits intoOct 19, 2026
Merged
Jens Hedegaard Nielsen (jenshnielsen) merged 5 commits into
Jens Hedegaard Nielsen (jenshnielsen) merged 5 commits into
Conversation
Jens Hedegaard Nielsen (jenshnielsen)
requested a review
from a team
as a code owner
October 17, 2026 19:23
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8626 +/- ##
==========================================
+ Coverage 72.58% 72.62% +0.03%
==========================================
Files 307 307
Lines 32409 32431 +22
==========================================
+ Hits 23525 23552 +27
+ Misses 8884 8879 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Jens Hedegaard Nielsen (jenshnielsen)
enabled auto-merge
October 19, 2026 07:30
AtomicConnection now registers itself in a weak set on creation and removes itself on close. close_all_connections() closes all connections that are still open, and get_open_connections() lists them. The tests use an autouse fixture that closes all connections after each test, replacing the gc.collect() calls that were used to release connections that had gone out of scope.
The connection is already closed explicitly, so there is no need to garbage collect to release it.
AtomicConnection now records the thread that created it, and close_all_connections() only closes connections owned by the calling thread, since sqlite connections cannot be closed from other threads. close_all_connections() is registered as an atexit handler. Complete the background-writer datasets in the concurrent dataset tests so that the writer threads shut down and close their connections.
SQLiteSettings left the in-memory connection it opens on import open, and some tests never closed plain sqlite3 connections. Document why the unclosed database warning is still filtered in tests.
Use a reentrant registry lock, preserve pre-existing fixture connections, isolate subprocess configuration, and complete new test annotations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Jens Hedegaard Nielsen (jenshnielsen)
force-pushed
the
cleanup_db_connections_simple
branch
from
October 19, 2026 09:40
f215e07 to
cc1af44
Compare
Cina Arjmand (CinaArjmand)
approved these changes
Oct 19, 2026
Jens Hedegaard Nielsen (jenshnielsen)
deleted the
cleanup_db_connections_simple
branch
October 19, 2026 11:52
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.
Local benchmarking shows a factor of 2 speed up in Linux but limited effect in Windows