[darcs-users] non-atomic pull

David Roundy droundy at abridgegame.org
Sat Oct 11 17:13:40 UTC 2003


On Sat, Oct 11, 2003 at 04:17:00PM +0300, Aggelos Economopoulos wrote:
> > I presume that you mean pull, not apply here.  Pull does write the patches
> > prior to appending to the inventory files.
> 
> No, not pull. Let's name A the 'darcs apply' process on your server, B
> your http server serving the requests of the 'darcs pull' on my
> machine. I was wondering if something like the following might have
> happened:
> 
> A -> write to inventory
> A -> open(O_CREAT) new patch file
> [A gets scheduled out]
> 
> B -> read inventory
> [darcs pull issues request for the new patch]
> B -> read from currently empty file
> 
> c -> write patch data
> 
> Although this is an unlikely race due to network latency, I can't confirm
> that apply does the right thing, so I just thought I'd ask.

I see.  No, apply also creates the patches first, and only then modifies
the inventory.

> > Are you using compression perhaps? When compression is used, the file write
> > is done asynchronously, so in theory you could have inventory updated prior
> > to the patch files being written.
> 
> Why would my inventory being out of sync have anything to do with the curl 
> error? Can you explain it further?

It wouldn't.  I didn't understand how your curl error related to a locking
issue, so I was guessing as to what could create a locking problem, and the
only thing that comes to mind is patch file compression, which is done
asynchronously (but isn't done on the abridgegame.org server, so it wasn't
the culprit here).
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list