CVS rsync hangs during local copy

Wayne Davison wayned at
Sat Jan 20 20:20:29 GMT 2007

On Sun, Jan 14, 2007 at 10:30:56PM -0500, Matt McCutchen wrote:
> I am finding that the CVS version of rsync hangs during most, but not
> all, local copies.  The problem goes away if I pass --protocol=29, so

I was only able to reproduce this with at least -vvv output, and the
hang also affected protocol 29.  The hang is happening when the
generator is trying to either forward a message from the receiver down
the socket, or it is creating a message while reading file-list data
from the receiver (e.g. when protocol 30 is reading the file-list info
from the receiver).  The problem occurs because an active read of the
receiver->generator pipe disables further reads on the pipe, and thus if
a write to the socket stalls, we risk deadlock should the receiver also
be stalled trying to write data to us.  Older rsyncs used a different
flushing method in the receiver when writing into the pipe which could
not deadlock, but the CVS version currently has this changed due to
protocol 30's need to flush file-list info without buffering.

I have checked-in a fix that ensures that we defer outgoing messages in
the generator whenever we disable reading from the receiver->generator
pipe.  I'm going to investigate if it would be possible to avoid
disabling the reading on the pipe altogether these days (I think it
should be easy, but haven't tried it yet).

Attached is the current fix that I checked in to CVS.  Thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: defer.patch
Type: text/x-diff
Size: 925 bytes
Desc: not available
Url :

More information about the rsync mailing list