This came up when I tested my latest changes to D.R.Packs: I wondered why
this is so extremely slow when I cloned a remote repo over ssh from my home
machine. Then I added --debug and saw that re-using the connection failed
each time.
1 patch for repository http://darcs.net/screened:
patch f4d8302036b82a26296f5201cc6959c836909595
Author: Ben Franksen <benjamin.franksen@helmholtz-berlin.de>
Date: Sun Jun 28 03:53:30 CEST 2015
* made connection caching in Darcs.Repository.Ssh thread safe
The module in question had a global variable implemented as an IORef which
does not play well with concurrent threads. The revised implementation uses
MVars and also takes care that a connection is only used by one thread at a
time. This fixes severe performance problems and intermittent failures when
cloning repos over ssh due to concurrent access from D.R.Packs.
Another problem was that the connections were identified by the user@host
part only, but not by the directory of the repo. This causes problems when
e.g. pulling from multiple ssh repos on the same user@host. We now use a
(user@host, repodir) pair as the key for cached connections.
Following up with a small re-factoring that depends on the fix.
2 patches for repository http://darcs.net/screened:
patch f4d8302036b82a26296f5201cc6959c836909595
Author: Ben Franksen <benjamin.franksen@helmholtz-berlin.de>
Date: Sun Jun 28 03:53:30 CEST 2015
* made connection caching in Darcs.Repository.Ssh thread safe
The module in question had a global variable implemented as an IORef which
does not play well with concurrent threads. The revised implementation uses
MVars and also takes care that a connection is only used by one thread at a
time. This fixes severe performance problems and intermittent failures when
cloning repos over ssh due to concurrent access from D.R.Packs.
Another problem was that the connections were identified by the user@host
part only, but not by the directory of the repo. This causes problems when
e.g. pulling from multiple ssh repos on the same user@host. We now use a
(user@host, repodir) pair as the key for cached connections.
patch 09283ac15a43a4f182726a583a8901fc474f48b9
Author: Ben Franksen <benjamin.franksen@helmholtz-berlin.de>
Date: Sun Jun 28 03:44:43 CEST 2015
* use transferModeHeader from D.R.Ssh in D.U.C.TransferMode
I agree it would be nice to have (and it applies cleanly to 2.10). I
have quickly looked at it and it looks sane. It would be nice if
someone could review it.
Guillaume
A small re-factoring on top of the ssh connection caching fix.
1 patch for repository http://darcs.net/screened:
patch 050d575189bd701f7a214b7e1d01aebe17ea2ad9
Author: Ben Franksen <benjamin.franksen@helmholtz-berlin.de>
Date: Thu Jul 2 15:06:28 CEST 2015
* simplified code in D.R.Ssh by using withMVar