[PATCH] Fix two pipe-initialization races that occur in replication.

Jim Meyering jim at meyering.net
Tue Oct 19 17:31:38 UTC 2010


Jim Meyering wrote:

> Jim Meyering wrote:
>
>> Jeff Darcy wrote:
>>> Turns out there were two race conditions, either of which could lead to
>>> a replication task hanging.  In the first, the consumer thread could
>>> potentially run before the pipe_shared structure was re-initialized in
>>> the producer.  In the second, the producer could post the first chunk
>>> before the consumer initialized its pipe_private, so the sequence
>>> numbers would be off.  That's kind of ironic, since the sequence number
>>> isn't strictly necessary and is only there to guard against a whole
>>> different class of synchronization problems (for which purpose I think
>>> it should remain).  Here's a brief summary.
>>>
>>> * replica.c: moved re-initialization of pipe_shared to be before thread
>>> start (race #1)
>>> * mpipe.c: changed initialization of pp->sequence in pipe_init_private
>>> (race #2)
>>> * iwh.h: added PID to DPRINTF to distinguish parent/child output
>>> * backend.c: fixed bytes==0 behavior in fs_put_child (unrelated)
>>> * rest.c: fixed pipe_prod_wait_init check in proxy_put_data (unrelated)
>>>
>>> P.S. This is on top of Jim's bison-flex series, but it probably doesn't
>>> matter.
>>
>> With that change set, both auto and replication tests still fail on rawhide.
>> It's also a bare-metal system, but this time on /dev/shm.
>
> Here are the logs:

One more time.
Jeff noticed that I had a preexisting mongod process running on 27018.
We'll have to make at least one test detect/diagnose that.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: auto.log
Url: https://fedorahosted.org/pipermail/iwhd-devel/attachments/20101019/81424e42/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: replication.log
Url: https://fedorahosted.org/pipermail/iwhd-devel/attachments/20101019/81424e42/attachment-0001.pl 


More information about the iwhd-devel mailing list