use SQL.addInodeCaches
This avoids deadlock when opening the database handle calls reconcileStaged.
This commit is contained in:
parent
73e0cbbb19
commit
a306560374
1 changed files with 7 additions and 5 deletions
|
@ -384,10 +384,14 @@ reconcileStaged qh = do
|
||||||
ics <- liftIO $ SQL.getInodeCaches key (SQL.ReadHandle qh)
|
ics <- liftIO $ SQL.getInodeCaches key (SQL.ReadHandle qh)
|
||||||
obj <- calcRepo (gitAnnexLocation key)
|
obj <- calcRepo (gitAnnexLocation key)
|
||||||
mobjic <- withTSDelta (liftIO . genInodeCache obj)
|
mobjic <- withTSDelta (liftIO . genInodeCache obj)
|
||||||
|
let addinodecaches k v = liftIO $
|
||||||
|
SQL.addInodeCaches k v (SQL.WriteHandle qh)
|
||||||
-- Like inAnnex, check the annex object is unmodified
|
-- Like inAnnex, check the annex object is unmodified
|
||||||
-- when annex.thin is set.
|
-- when annex.thin is set.
|
||||||
keypopulated <- ifM (annexThin <$> Annex.getGitConfig)
|
keypopulated <- ifM (annexThin <$> Annex.getGitConfig)
|
||||||
( maybe (pure False) (\objic -> isUnmodifiedLowLevel addInodeCaches key obj objic ics) mobjic
|
( case mobjic of
|
||||||
|
Just objic -> isUnmodifiedLowLevel addinodecaches key obj objic ics
|
||||||
|
Nothing -> pure False
|
||||||
, pure (isJust mobjic)
|
, pure (isJust mobjic)
|
||||||
)
|
)
|
||||||
p <- fromRepo $ fromTopFilePath file
|
p <- fromRepo $ fromTopFilePath file
|
||||||
|
@ -396,10 +400,8 @@ reconcileStaged qh = do
|
||||||
(True, False) ->
|
(True, False) ->
|
||||||
populatePointerFile (Restage True) key obj p >>= \case
|
populatePointerFile (Restage True) key obj p >>= \case
|
||||||
Nothing -> return ()
|
Nothing -> return ()
|
||||||
Just ic -> liftIO $
|
Just ic -> addinodecaches key
|
||||||
SQL.addInodeCaches key
|
(catMaybes [Just ic, mobjic])
|
||||||
(catMaybes [Just ic, mobjic])
|
|
||||||
(SQL.WriteHandle qh)
|
|
||||||
(False, True) -> depopulatePointerFile key p
|
(False, True) -> depopulatePointerFile key p
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue