error in rsync protocol data stream

Cristian Gafton gafton at redhat.com
Fri Feb 13 00:00:16 GMT 2004


On Thu, 12 Feb 2004, jw schultz wrote:

> Try this patch which adds an arbitrary 100ms back-off delay
> to hopefully give the system a chance to recover.

There should be some counting done - if rsync ends up banging too often 
against ENOBUFS it might get in the crosshairs of the OOM killer. Maybe we 
might want to even consider a sync() call after a number of ENOBUFS?


> Index: io.c
> ===================================================================
> RCS file: /data/cvs/rsync/io.c,v
> retrieving revision 1.115
> diff -u -p -r1.115 io.c
> --- io.c	26 Dec 2003 23:04:01 -0000	1.115
> +++ io.c	12 Feb 2004 23:33:42 -0000
> @@ -655,6 +655,11 @@ static void writefd_unbuffered(int fd,ch
>  				continue;
>  			}
>  
> +			if (ret == -1 && errno == ENOBUFS) {
> +				msleep(100); /* system overload, back off */
> +				continue;
> +			}
> +
>  			if (ret <= 0) {
>  				/* Don't try to write errors back
>  				 * across the stream */
> -- 

Cristian
--
----------------------------------------------------------------------
Cristian Gafton     --     gafton at redhat.com      --     Red Hat, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  "There are two kinds of people who never amount to much: those who 
   cannot do what they are told, and those who can do nothing else."
        --Cyrus Curtis


More information about the rsync mailing list