[darcs-users] non-atomic pull

Aggelos Economopoulos aoiko at cc.ece.ntua.gr
Sat Oct 11 13:17:00 UTC 2003


On Saturday 11 October 2003 15:44, David Roundy wrote:
> On Sat, Oct 11, 2003 at 03:29:53PM +0300, Aggelos Economopoulos wrote:
> > Is this a known problem?
> >
> > aggelos at erwin:~/src/darcs/darcs> darcs pull
> > Pulling from http://abridgegame.org/repos/darcs...
> >
> > Fail: user error
> > Reason: Failed to download URL http://abridgegame.org/repos/darcs/_darcs/
> > patches/
> > refuse_to_setpref_an_invalid_pref_field.-David_Roundy_2droundy9abridgegam
> >e.org7-Sat_Oct_11_07.38.49_EDT_2003 error code: 52
> >
> > aggelos at erwin:~/src/darcs/darcs> darcs pull
> > Pulling from http://abridgegame.org/repos/darcs...
> > [refuse to setpref an invalid pref field.
> > David Roundy <droundy at abridgegame.org>**Sat Oct 11 07:38:49 EDT 2003]
> > Shall I pull this patch? [ynvaswh] y
> > So far so good... the merge succeeded.
> > Finished pulling.
> > aggelos at erwin:~/src/darcs/darcs>
>
> I'm afraid I don't quite follow what you quote above.  It seems that you
> ran pull once and got a network error of some sort, and then ran again, and
> everything worked fine.  Where's the problem?

Well, 52 is CURLE_GOT_NOTHING. You're assuming the http server incorrectly 
returned no data, but I was thinking of the race described below.

> > It seems that apply appends the recorded patch names to _darcs/inventory
> > _before_ writing the patch files in _darcs/patches.
>
> 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.

> 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?

Thanks,
Aggelos 





More information about the darcs-users mailing list