fix a thundering herd problem
authorJoey Hess <joeyh@joeyh.name>
Fri, 17 Apr 2020 21:09:29 +0000 (17:09 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 17 Apr 2020 21:09:29 +0000 (17:09 -0400)
commit529f488ec4758459f3e44f863615a19b74a6df63
treeb870ebe95e4ce3489a0c410b516b6fd4ed888170
parentfada5c120c76fb6fdfbfb16ff6ea291919724c4d
fix a thundering herd problem

Avoid repeatedly opening keys db when accessing a local git remote and -J
is used.

What was happening was that Remote.Git.onLocal created a new annex state
as each thread started up. The way the MVar was used did not prevent that.
And that, in turn, led to repeated opening of the keys db, as well as
probably other extra work or resource use.

Also managed to get rid of Annex.remoteannexstate, and it turned out there
was an unncessary Maybe in the keysdbhandle, since the handle starts out
closed.
Annex.hs
CHANGELOG
Command/Sync.hs
Database/Keys.hs
Remote/Git.hs