fix deadlock
authorJoey Hess <joeyh@joeyh.name>
Mon, 24 May 2021 19:31:06 +0000 (15:31 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 24 May 2021 20:19:26 +0000 (16:19 -0400)
commit73e1507c72f656fb009b4c372f489698d5206bb6
treefab8ab984e361a81c2255dcbffb38b0363079b45
parent5d189947363401d0fa199d10fe44fb5a1d2717d0
fix deadlock

git-annex test hung, at varying points depending
on when git decided to run the smudge clean filter.

Recent changes to reconcileStaged caused a deadlock, when git write-tree
for some reason decides to run the smudge clean filter. Which tries
to open the keys db, and blocks waiting for the lock file that its
grandparent has locked.

I don't know why git write-tree does that. It's supposed to only write a
tree from the index which needs no smudge/clean filtering.

I've verified that, in a situation where git write-tree runs the clean
filter, disabling the filter results in a tree being written that
contains the annex link, not eg, the worktree file content. So it seems
safe to disable the clean filter, but also this seems likely to be
working around a bug in git because it seems it is running the clean
filter in a situation where the object has already been cleaned.

Sponsored-by: Dartmouth College's Datalad project
Database/Keys.hs