summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-16 14:05:26 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-16 14:05:26 -0400
commit9325c324b567736772a4d52e84c3a11f7c082459 (patch)
tree97eff2dddef42b1c15bd682b6cf1d4db43d5a96a /Annex.hs
parente63472c258f72656455beaa118d4ba43b615621e (diff)
temporarily remove cached keys database connection
The problem is that shutdown is not always called, particularly in the test suite. So, a database connection would be opened, possibly some changes queued, and then not shut down. One way this can happen is when using Annex.eval or Annex.run with a new state. A better fix might be to make both of them call Keys.shutdown (and be sure to do it even if the annex action threw an error). Complication: Sometimes they're run reusing an existing state, so shutting down a database connection could cause problems for other users of that same state. I think this would need a MVar holding the database handle, so it could be emptied once shut down, and another user of the database connection could then start up a new one if it got shut down. But, what if 2 threads were concurrently using the same database handle and one shut it down while the other was writing to it? Urgh. Might have to go that route eventually to get the database access to run fast enough. For now, a quick fix to get the test suite happier, at the expense of speed.
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs3
1 files changed, 0 insertions, 3 deletions
diff --git a/Annex.hs b/Annex.hs
index c4df0b92f..c9a4ef6a0 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -60,7 +60,6 @@ import Types.NumCopies
import Types.LockCache
import Types.DesktopNotify
import Types.CleanupActions
-import qualified Database.Keys.Types
#ifdef WITH_QUVI
import Utility.Quvi (QuviVersion)
#endif
@@ -135,7 +134,6 @@ data AnnexState = AnnexState
, desktopnotify :: DesktopNotify
, workers :: [Either AnnexState (Async AnnexState)]
, concurrentjobs :: Maybe Int
- , keysdbhandle :: Maybe Database.Keys.Types.DbHandle
}
newState :: GitConfig -> Git.Repo -> AnnexState
@@ -181,7 +179,6 @@ newState c r = AnnexState
, desktopnotify = mempty
, workers = []
, concurrentjobs = Nothing
- , keysdbhandle = Nothing
}
{- Makes an Annex state object for the specified git repo.