Bug 6175 - write last transfer status when timeout or other error happens
Summary: write last transfer status when timeout or other error happens
Status: NEW
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.5
Hardware: Other Linux
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-08 06:07 UTC by Arkadiusz Miskiewicz
Modified: 2010-10-27 00:30 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arkadiusz Miskiewicz 2009-03-08 06:07:56 UTC
At this moment when timeout happens we get:

sending incremental file list
some.file
Timeout, server not responding.  0:33:43

rsync: writefd_unbuffered failed to write 4 bytes [sender]: Broken pipe (32)
rsync: connection unexpectedly closed (99113 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(600) [sender=3.0.5]


I miss last info about tranfer before it failed. For example:

sending incremental file list
some.file
   222804096  40%   94.66kB/s    0:33:42
Timeout, server not responding.  0:33:43

rsync: writefd_unbuffered failed to write 4 bytes [sender]: Broken pipe (32)
rsync: connection unexpectedly closed (99113 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(600) [sender=3.0.5]

Note the new "   222804096  40%   94.66kB/s    0:33:42" line.

Right now there is no information when (in terms of % transmitted) it failed etc.
Comment 1 Arkadiusz Miskiewicz 2009-03-08 06:14:38 UTC
Ah, that was "rsync -avPc".
Comment 2 Matt McCutchen 2009-03-08 20:05:27 UTC
Rsync does leave the progress line on the screen, but ssh is printing the "Timeout, server not responding" message that overwrites it.  Rsync could simply reprint the most recent progress line, beginning with \r, just before reporting loss of the connection.  With no intervening ssh message, this would back up and overwrite the existing progress line with the same text; with an intervening message, the output would look like this:

some.file
Timeout, server not responding.  0:33:42
   222804096  40%   94.66kB/s    0:33:42

Wayne, what do you think?
Comment 3 Wayne Davison 2009-03-08 21:52:55 UTC
3.1.0 keeps the cursor at the end of the line, so ssh can't overwrite it.  Is there something else to fix here?
Comment 4 Matt McCutchen 2009-03-08 22:03:16 UTC
(In reply to comment #3)
> 3.1.0 keeps the cursor at the end of the line, so ssh can't overwrite it.  Is
> there something else to fix here?

You're right.  Looking at the 3.1.0 code without realizing that part had changed from 3.0.5, I wrongly concluded that ssh must have written a \r, which would be pretty perverse but for which my proposed fix would be appropriate.

So there's nothing to fix here except perhaps to backport the change you mentioned to the 3.0.x branch.
Comment 5 Tim Taiwanese Liim 2010-10-27 00:30:54 UTC
These bugs seem to be related (having similar error messages:
connection unexpectedly closed, broken pipe, timeout).

bug7757
    with big file, rsync times out out when it should not; the 
    sender is still responsive

bug2783
    Random high loads during syncs (server side) / client stream errors
    rsync: connection unexpectedly closed (2761332 bytes received so far)
    [generator]
    rsync error: error in rsync protocol data stream (code 12) at io.c(365)

bug5478
    rsync: writefd_unbuffered failed to write 4092 bytes [sender]: 
                Broken pipe (32)

    rsync: writefd_unbuffered failed to write 4092 bytes [sender]: 
                Broken pipe (32)
    io timeout after 30 seconds -- exiting
    rsync error: timeout in data send/receive (code 30) at io.c(239) 
                [sender=3.0.2]

bug5695
    improve keep-alive code to handle long-running directory scans

    ./io.c:void maybe_send_keepalive(void)

bug6175
    write last transfer status when timeout or other error happens
    rsync: writefd_unbuffered failed to write 4 bytes [sender]: 
           Broken pipe (32)
    rsync: connection unexpectedly closed (99113 bytes received so 
           far) [sender]
    rsync error: unexplained error (code 255) at io.c(600) [sender=3.0.5]

bug7195
    timeout reached while sending checksums for very large files