explicitly close keys db in saveState
Should be redundant, but test suite is ending up with a lot of extra sqlite connections before unused keys database handles get garbage collected. While running the test suite, I often saw 2-4+ open fds to the same repo's keys database. After this change, it seems to mostly have 1, occasionally 2. And that might explain some of the strange sqlite failures in the test suite. Especially the failures of test_lock_v7_force, where the keys database gets renamed to a new directory out from under sqlite.
This commit is contained in:
parent
fcc9eea554
commit
1c71f563e0
1 changed files with 1 additions and 0 deletions
|
@ -867,6 +867,7 @@ getKeysPresent keyloc = do
|
|||
saveState :: Bool -> Annex ()
|
||||
saveState nocommit = doSideAction $ do
|
||||
Annex.Queue.flush
|
||||
Database.Keys.closeDb
|
||||
unless nocommit $
|
||||
whenM (annexAlwaysCommit <$> Annex.getGitConfig) $
|
||||
Annex.Branch.commit =<< Annex.Branch.commitMessage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue