wierd duration shown in progress with 0 byte files

Wayne Davison wayned at samba.org
Sat Mar 5 17:57:34 GMT 2005


On Fri, Mar 04, 2005 at 11:13:22PM +0100, Paul Slootman wrote:
>            0 100%    0.00kB/s  519:35:46  (61, 56.3% of 597)
> 
> This is quite reproducable whenever an empty file is transferred (or
> created on the receiving end).

This is caused by the ph_start.time value being 0 for a 0-length file
(it's only initialized when the first hunk of data comes through for a
file).  I just checked-in a fix for this into CVS.

Interestingly, when pushing data, no progress was output at all for an
empty file.  Since this is inconsistent, I changed the code to produce
progress in both directions.

> I don't quite see the point of setting diff to 1ms if it's zero...

Because an elapsed time of 0 means that any data that arrived, arrived
very quickly.  Setting the rate to 0 when the elapsed time is 0 is the
opposite of what we need -- an infinite data rate.  I like the idiom of
changing the elapsed time from 0 to 1 so that it divides safely into the
quantity of sent data, and thus gives us a non-0 rate (if any data was
actually sent).

Thanks for pointing out the weird output!

..wayne..


More information about the rsync mailing list