[darcs-devel] Starting release process for darcs-2.10.1?

Ben Franksen ben.franksen at online.de
Wed Jul 1 21:20:16 UTC 2015


Guillaume Hoffmann wrote:
> I think the current 3 "almost ready" things for a 2.10.1 release would be:
> 
> * Reviewing "made connection caching in Darcs.Repository.Ssh thread safe"

I recently discovered that using MVars in Darcs can be hazardous. The 
problem is that we use lazy IO in many places, for instance when reading the 
whole repository (readRepo). This can cause rather unexpected deadlocks when 
an MVar is taken and, inside the code that has the MVar, something causes 
more patches (or other things) to be evaluated, which in turn causes the 
deferred IO action to actually happen, which in turn might need access to 
the stuff in the MVar.

This happened to me when I worked on the revised cache implementation (to 
make the sources hint unnecessary). I could solve the problem by using 
readMVar instead of withMVar for any actions that might (indirectly) involve 
repo operations.

These considerations should be taken into account when reviewing this 
change. I will also take another look at the patch to see if I spot anything 
that might cause trouble.

In the long run I would like to replace lazy IO with something that is 
easier to reason about. Having effects re-ordered in obscure ways (depending 
on the -- otherwise unobservable! -- evaluation order) is just a recipe for 
disaster, especially in combination with concurrency. I already mentioned 
libraries for effectful streaming (pipes, etc) that claim to solve this 
problem. But I have to admit I have not yet used any of them in anger, so I 
can't tell if that idea would work in practice. In order to make such a 
change in healthily small steps, we'd probably need compatibility wrappers 
to turn an effectful stream into a classical (lazy-IO) value.

> * A correct fix for issue2461 (darcs log --repo=remoterepo creates _darcs)

Done. (Just sent a follow-up to the same patch number).

> * Deciding on accepting the manually rebased fix "resolve issue2459:
> fall back to writing the file if createLink fails"

I did not realize before that the "bad" dependency was the "Drop GHC 7.4 
support" change. The patch that resolves issue2400 has almost the same set 
of dependencies. Some of those dependencies I would like to see in 2.10 
anyway:

patch e1ed3b126134983f223ae0907dad11e2d1dcb3da
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Fri Feb 13 03:17:12 CET 2015
  * beautified error messages for command line and default files

patch fbf4af538131009e0929b6b6429d154706b97fd5
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Sun Feb 22 22:14:01 CET 2015
  * purify Darcs.UI.Defaults, fixing two problems on the way

These are relatively shallow changes that improve the user interface.

patch ef32279fc7834282117053f01712bc07459da75f
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Wed Feb 11 01:12:02 CET 2015
  * errorDoc now prints a stack trace (if profiling was enabled)

This could be helpful in case a user hits an "impossible" bug: we can tell 
them to install a profiling enabled version and send us the output 
containing the stack trace.

The other dependencies are mostly harmless re-factorings, except the 
mentioned "Drop GHC 7.4 support" patch.

Perhaps it is wiser to just pull the two fixes together with their 
dependencies in the 2.10 branch, and then rollback those parts that actually 
drop ghc 4.7 support.

Cheers
Ben
-- 
"Make it so they have to reboot after every typo." ― Scott Adams




More information about the darcs-devel mailing list