error in rsync protocol data stream

jw schultz jw at pegasys.ws
Thu Feb 12 23:38:32 GMT 2004


On Thu, Feb 12, 2004 at 02:14:12PM -0500, Ray Lischner wrote:
> On Thursday 12 February 2004 12:44 pm, Ray Lischner wrote:
> 
> > I am trying to backup an entire disk to a USB-mounted disk, for backup
> > purposes. Many files are copied, but eventually rsync dies:
> 
> I tried it again, and this time it fails at a different point and with a
> different error:
> 
> $ rsync -axHSv --delete /backup /media/sda1
> ...
> rsync: writefd_unbuffered failed to write 32768 bytes: phase "unknown":
> No buffer space available
> rsync error: error in rsync protocol data stream (code 12) at io.c(666)
> 
> As I mentioned in my previous post, the system has 192MB RAM, 400MB
> swap. The file system I am trying to copy takes up about 15GB.

You have run out of memory.  Per the SuSE distributed
write(2) manpage ENOBUFS is not supposed to happen but SUSv3
does list such an error.

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

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 */
-- 
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt


More information about the rsync mailing list