Cygwin/rsync Hang Problem Testing Results

jw schultz jw at pegasys.ws
Sat Oct 4 20:34:13 EST 2003


On Sat, Oct 04, 2003 at 08:38:20AM +0200, Lapo Luchini wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Paul Thompson wrote:
> 
> | 2.4.5     success     success 2.4.6     failure     failure
> 
> Funny this is: 2.4.6 is exactly the release where many cygwin-related
> patches landed in rsync code, as I'm seeing from a diff.
> (I began packaging rsync on CygWin at 2.4.6 and I never had your good
> idea to test older versions too, what a chanche it is that 2.4.5 is the
> first working one!)
> 
> I attach an purposedly incomplete diff between sources of 2.4.5 and
> 2.4.6 (I removed 'uninteresting' changes such as configure script
> changing line numbers...)
> 
> [Most notable difference is the addiction of shutdown and the lowering
> of the sleep time.]

That difference is notable although the shutdown function
has been removed since.  I'm not sure what replaced it
unless perhaps close_all which is conditional on
SHUTDOWN_ALL_SOCKETS.

> diff -bu rsync-2.4.5/io.c rsync-2.4.6/io.c
> --- rsync-2.4.5/io.c	2000-06-06 23:13:05.000000000 +0200
> +++ rsync-2.4.6/io.c	2000-08-29 07:07:08.000000000 +0200
> @@ -473,6 +464,17 @@
>  	}
>  }
>  
> +/* some OSes have a bug where an exit causes the pending writes on
> +   a socket to be flushed. Do an explicit shutdown to try to prevent this */

Not entirely sure if the comment author means flushed or
lost.  Close does not guarantee a flush although it is
usually implied.  Why you would want to discard pending
writes rather than flush them i'm not sure.

It does bring up the random thought that perhaps the cygwin
pipes to ssh aren't getting flushed on close and that is
somehow inducing the hang.

> +void io_shutdown(void)
> +{
> +	if (multiplex_out_fd != -1) close(multiplex_out_fd);
> +	if (io_error_fd != -1) close(io_error_fd);
> +	multiplex_out_fd = -1;
> +	io_error_fd = -1;
> +}
> +
> +
>  static void writefd(int fd,char *buf,int len)
>  {
>  	stats.total_written += len;
> @@ -623,8 +625,3 @@
>  	io_multiplexing_out = 0;
>  }
>  
> -void io_close_input(int fd)
> -{
> -	buffer_f_in = -1;
> -}
> -



More information about the rsync mailing list