[darcs-devel] [patch1373] refactored Darcs.Repository (and 1 more)

Ben Franksen bugs at darcs.net
Mon Jun 22 00:07:45 UTC 2015


New submission from Ben Franksen <benjamin.franksen at helmholtz-berlin.de>:

Sorry for bundling the refactoring with the fix but Darcs.Repository was a
monster. Separating out the concurrency related stuff was a prerequisite for
me to get an idea what's going on.

2 patches for repository http://darcs.net/screened:

patch 109a5667e7cf1f4db879a2aa4076237229f90b09
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Sun Jun 21 23:49:33 CEST 2015
  * refactored Darcs.Repository
  
  All the code implementing cloneRepository and createRepository moved to a
  separate module Darcs.Repository.Clone and only re-exported by
  Darcs.Repository. Only a few small functions remain in Darcs.Repository,
  which was certainly originally intended to be for re-exporting only.
  
  Furthermore, moved the fetching and unpacking code used by cloneRepository
  and createRepository to separate module Darcs.Repository.Packs. This module
  now contains all the tricky concurrency code that I suspect being reponsible
  for causing issue2400.
  
  This patch makes no functional changes. The only changes beside the above
  two large refactorings are
  - culling (and some sorting) of the imports
  - inlining of copyRepoAndGoToChosenVersion into cloneRepository
  - consistent use of the </> operator from System.FilePath
  - combine fetching and unpacking of the packs in a function

patch 466ac99075e1bdcd19cba29dc7c669bae1c15fd1
Author: Ben Franksen <benjamin.franksen at helmholtz-berlin.de>
Date:   Sun Jun 21 23:54:09 CEST 2015
  * resolve issue2400: use async package to keep track of unpack threads
  
  The main difference is that we now cancel all threads when the job is done.
  The previous implementation left one of the threads running and I suspect
  (but haven't strictly verified) that this caused the error message. There is
  rather strong evidence though: turning on debug messages makes the problem
  disappear, as did turning off the concurrency (by commenting out the
  forkIO), both of which suggests a race condition. Then there is the fact
  that the clone actually succeeded despite the error message. Last not least,
  with this patch in effect I can no longer reproduce the problem.

----------
files: patch-preview.txt, refactored-darcs_repository.dpatch, unnamed
messages: 18579
nosy: bf
status: needs-screening
title: refactored Darcs.Repository (and 1 more)

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1373>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-preview.txt
Type: text/x-darcs-patch
Size: 65616 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150622/e3681a55/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: refactored-darcs_repository.dpatch
Type: application/x-darcs-patch
Size: 93280 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150622/e3681a55/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unnamed
Type: application/octet-stream
Size: 5 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20150622/e3681a55/attachment-0001.obj>


More information about the darcs-devel mailing list