rsync / cygwin hanging problem

cbarratt at cbarratt at
Sat Nov 29 07:49:35 EST 2003

jw schultz writes:

> > So anyway, I know the "rsync sometimes hangs under cygwin"
> > problem has been acknowledged, but does anybody know
> > anything about when it might be identified and resolved?
> As far as i can tell none of the people who know the rsync
> code use Windows with the possible exception of Craig.  He
> has a patch that may reduce the frequency of hangs but his
> recommendation (if i recall correctly) is to not use rsync
> over ssh on windows.  Rsync apparently works OK as a daemon
> on whendoze and when accessing an rsync daemon.

The problem on Cygwin is the parent fails to kill the child at the
end of a receive.  Without finding the root-cause (I don't know
about cygwin internals), I rearranged the code around the msleep
loop to create a patch did solve the problem for me:

But several other people have reported that it didn't help.

Following that, Anthony Heading came up with a new patch that
used an additional pipe, instead of a signal, to tell the child
to exit:

with a diff -u patch here:

James Tillman reported that this fixed his hang problem on Cygwin.
But JW noted this produced an error in regression testing:

and then he provided an improved patch:

and Lapo Luchini came up with a test package with the patch:

but noted it failed make check.  Shortly after that point the thread

The basic approach in the patch looks sound. Unfortunately I haven't had
the time to follow through on these patches.  Plus my test case that used
to create a hang isn't easy to replicate for me.

John Hunt writes:

> If any developer is working on this problem, I would be happy to
> test any new rsync executable for them, to establish if it works
> in my environment.

Why don't you try JW's last patch above?  Something close to this
should be a reliable fix.


More information about the rsync mailing list