Commit graph

7169 commits

Author SHA1 Message Date
Joey Hess
7eb6af07b9 Merge branch 'master' of ssh://git-annex.branchable.com 2013-05-19 14:25:08 -04:00
Joey Hess
345ee4f37c Switch to MonadCatchIO-transformers for better handling of state while catching exceptions.
As seen in this bug report, the lifted exception handling using the StateT
monad throws away state changes when an action throws an exception.
http://git-annex.branchable.com/bugs/git_annex_fork_bombs_on_gpg_file/
  .. Which can result in cached values being redundantly calculated, or other
     possibly worse bugs when the annex state gets out of sync with reality.

This switches from a StateT AnnexState to a ReaderT (MVar AnnexState).
All changes to the state go via the MVar. So when an Annex action is
running inside an exception handler, and it makes some changes, they
immediately go into affect in the MVar. If it then throws an exception
(or even crashes its thread!), the state changes are still in effect.

The MonadCatchIO-transformers change is actually only incidental.
I could have kept on using lifted-base for the exception handling.
However, I'd have needed to write a new instance of MonadBaseControl
for the new monad.. and I didn't write the old instance.. I begged Bas
and he kindly sent it to me. Happily, MonadCatchIO-transformers is
able to derive a MonadCatchIO instance for my monad.

This is a deep level change. It passes the test suite! What could it break?

Well.. The most likely breakage would be to code that runs an Annex action
in an exception handler, and *wants* state changes to be thrown away.
Perhaps the state changes leaves the state inconsistent, or wrong. Since
there are relatively few places in git-annex that catch exceptions in the
Annex monad, and the AnnexState is generally just used to cache calculated
data, this is unlikely to be a problem.

Oh yeah, this change also makes Assistant.Types.ThreadedMonad a bit
redundant. It's now entirely possible to run concurrent Annex actions in
different threads, all sharing access to the same state! The ThreadedMonad
just adds some extra work on top of that, with its own MVar, and avoids
such actions possibly stepping on one-another's toes. I have not gotten
rid of it, but might try that later. Being able to run concurrent Annex
actions would simplify parts of the Assistant code.
2013-05-19 14:16:36 -04:00
http://joeyh.name/
4e082feb8c Added a comment 2013-05-19 16:39:45 +00:00
http://me.tinco.nl/
870a77fa26 Added a comment 2013-05-19 15:37:24 +00:00
http://me.tinco.nl/
300646eb6a Added a comment 2013-05-19 15:35:27 +00:00
http://me.tinco.nl/
d4da9bb84b 2013-05-19 15:15:04 +00:00
https://www.google.com/accounts/o8/id?id=AItOawnu1NYw8UF-NoDbKu8YKVGxi8FoZLH7JPs
47680d8e82 Added a comment: Not starting browser on Nexus 7, Android 4.2.2 2013-05-19 14:04:28 +00:00
http://me.tinco.nl/
8626bfd29d Added a comment 2013-05-19 12:37:23 +00:00
https://www.google.com/accounts/o8/id?id=AItOawmubB1Sj2rwFoVdZYvGV0ACaQUJQyiJXJI
d2a59a40bb Added a comment: GTalk/XMPP 2013-05-19 09:58:51 +00:00
https://www.google.com/accounts/o8/id?id=AItOawmUJBh1lYmvfCCiGr3yrdx-QhuLCSRnU5c
f3086f8259 Added a comment 2013-05-19 05:56:46 +00:00
http://me.tinco.nl/
e901e5aa28 Added a comment 2013-05-19 03:15:10 +00:00
http://joeyh.name/
cd21cd9497 Added a comment 2013-05-18 23:59:59 +00:00
http://me.tinco.nl/
cae1ca2588 Added a comment 2013-05-18 23:36:22 +00:00
http://me.tinco.nl/
c3effd055a Added a comment 2013-05-18 23:32:32 +00:00
http://me.tinco.nl/
7887c15168 2013-05-18 22:59:11 +00:00
https://me.yahoo.com/a/BjlC7xlnk_b7HrB9HA0fHOnYSha7RhaYa.4-#acb55
263a6ea684 2013-05-18 09:51:13 +00:00
Richard Hartmann
b70af62185 Typo
Combed with extra fine teeth just to make Joey happy ;)
2013-05-18 09:59:53 +02:00
http://yarikoptic.myopenid.com/
c8bc9886a2 Added a comment: Follow-up information on my system 2013-05-18 01:23:28 +00:00
https://www.google.com/accounts/o8/id?id=AItOawkGCmVc5qIJaQQgG82Hc5zzBdAVdhe2JEM
4f6d602f8f Fixed a typo 2013-05-17 22:39:50 +00:00
http://joeyh.name/
4090125a1b Added a comment 2013-05-17 22:28:34 +00:00
Joey Hess
48a19771c6 Merge branch 'master' of ssh://git-annex.branchable.com 2013-05-17 18:24:52 -04:00
Joey Hess
3174447a1d blog for the day 2013-05-17 18:24:21 -04:00
https://www.google.com/accounts/o8/id?id=AItOawnSenxKyE_2Z6Wb-EBMO8FciyRywjx1ZiQ
3a0bd23c89 2013-05-17 21:20:42 +00:00
Joey Hess
83db599b6e remove old comments, there is a build script now 2013-05-17 14:36:47 -04:00
Joey Hess
51592944a2 fix link 2013-05-17 14:36:16 -04:00
Joey Hess
ddf98cd644 update 2013-05-17 13:45:33 -04:00
Joey Hess
4ba6a88aba update with autobuilder 2013-05-17 13:38:45 -04:00
Joey Hess
14ba77c632 Merge branch 'master' of ssh://git-annex.branchable.com 2013-05-17 11:39:48 -04:00
Joey Hess
ebe10edf67 add dep needed with newer ghc 2013-05-17 11:24:07 -04:00
basak
5fef411563 Added a comment 2013-05-17 08:35:15 +00:00
https://www.google.com/accounts/o8/id?id=AItOawmubB1Sj2rwFoVdZYvGV0ACaQUJQyiJXJI
434f9adcf4 Added a comment: Continued work 2013-05-17 07:44:38 +00:00
http://a-or-b.myopenid.com/
516d4c3641 2013-05-17 00:54:51 +00:00
Joey Hess
3921c7b676 Merge branch 'master' of ssh://git-annex.branchable.com 2013-05-16 19:05:08 -04:00
Joey Hess
454941dd22 blog for the day 2013-05-16 18:57:14 -04:00
http://yarikoptic.myopenid.com/
927e0c43f0 Added a comment: Does it require the device to be rooted? 2013-05-16 20:55:46 +00:00
https://www.google.com/accounts/o8/id?id=AItOawnmvJtM53ZX9h8OGQoU2t2OfGwrF7rxFX0
8c20c51152 2013-05-16 20:40:09 +00:00
https://www.google.com/accounts/o8/id?id=AItOawkSq2FDpK2n66QRUxtqqdbyDuwgbQmUWus
b5d8db6a7b Added a comment 2013-05-16 17:31:40 +00:00
Joey Hess
3d3d40d546 Merge branch 'master' of ssh://git-annex.branchable.com 2013-05-16 12:22:10 -04:00
Joey Hess
616737de79 wording 2013-05-16 12:21:56 -04:00
http://joeyh.name/
47a035b748 Added a comment 2013-05-16 16:17:52 +00:00
Joey Hess
b4f1edd581 update 2013-05-16 12:09:13 -04:00
Joey Hess
b2e57f8ddd update 2013-05-16 12:09:10 -04:00
Joey Hess
17a00fbd97 add news item for git-annex 4.20130516 2013-05-16 11:37:30 -04:00
Joey Hess
2c832f6aae close 2013-05-16 10:48:45 -04:00
Joey Hess
4f8b21a0d5 Merge branch 'master' of ssh://git-annex.branchable.com 2013-05-16 10:44:52 -04:00
https://www.google.com/accounts/o8/id?id=AItOawlOc-EOD5ZyggsAp6lOnU7x5MxizwLtUXA
82fde5d020 2013-05-16 13:18:44 +00:00
http://svario.it/gioele
93f8578c4b Added a comment: Maybe using branches? 2013-05-16 10:22:48 +00:00
http://svario.it/gioele
948999926a new wishlist: remove files and symlinks but keep in remote 2013-05-16 10:15:29 +00:00
https://www.google.com/accounts/o8/id?id=AItOawmWg4VvDTer9f49Y3z-R0AH16P4d1ygotA
bc292555cc 2013-05-16 09:40:38 +00:00
https://www.google.com/accounts/o8/id?id=AItOawkF8_uQjLYm5Mf5F_JuVW-BxlvzpWjvR_o
edc4ccdfbf Added a comment: Android success 2013-05-16 04:14:10 +00:00