git-annex/Assistant/Threads
Joey Hess adf5195082 run current branch merge in annex monad
I was seeing some interesting crashes after the previous commit,
when making file changes slightly faster than the assistant could keep up.

error: Ref refs/heads/master is at 7074f8e0a11110c532d06746e334f2fec6af6ab4 but expected 95ea86008d72a40d97a81cfc8fb47a0da92166bd
fatal: cannot lock HEAD ref
Committer crashed: git commit [Param "--allow-empty-message",Param "-m",Param "",Param "--allow-empty",Param "--quiet"] failed
Pusher crashed: thread blocked indefinitely in an STM transaction

Clearly the the merger ended up running at the same time as the committer,
and with both modifying HEAD the committer crashed. I fixed that by
making the Merger run its merge inside the annex monad, which avoids
it running concurrently with other git operations. Also by making
the committer not crash if git fails.

What I don't understand is why the pusher then crashed with a STM deadlock.
That must be in either the DaemonStatusHandle or the FailedPushMap,
and the latter is only used by the pusher. Did the committer's crash somehow
break STM?

The BlockedIndefinitelyOnSTM exception is described as:

-- |The thread is waiting to retry an STM transaction, but there are no
-- other references to any @TVar@s involved, so it can't ever continue.

If the Committer had a reference to a TVar and crashed, I can sort of see
this leading to that exception..

The crash was quite easy to reproduce after the previous commit, but
after making the above change, I have yet to see it again. Here's hoping.
2012-09-17 22:04:43 -04:00
..
Committer.hs run current branch merge in annex monad 2012-09-17 22:04:43 -04:00
DaemonStatus.hs display errors when any named thread crashes 2012-09-06 14:56:04 -04:00
Merger.hs run current branch merge in annex monad 2012-09-17 22:04:43 -04:00
MountWatcher.hs display errors when any named thread crashes 2012-09-06 14:56:04 -04:00
NetWatcher.hs hlint 2012-09-13 00:57:52 -04:00
PairListener.hs hlint 2012-09-13 00:57:52 -04:00
Pusher.hs hlint 2012-09-13 00:57:52 -04:00
SanityChecker.hs display errors when any named thread crashes 2012-09-06 14:56:04 -04:00
TransferPoller.hs display errors when any named thread crashes 2012-09-06 14:56:04 -04:00
Transferrer.hs simplify 2012-09-17 13:41:13 -04:00
TransferScanner.hs cleanup 2012-09-17 14:58:43 -04:00
TransferWatcher.hs hlint 2012-09-13 00:57:52 -04:00
Watcher.hs hlint 2012-09-13 00:57:52 -04:00
WebApp.hs hlint 2012-09-13 00:57:52 -04:00