Improve progress display when watching file size, in cases where a transfer does not resume.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2017-05-25 14:30:18 -04:00
parent 78b9e9c67f
commit 9bddc6d5ca
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 45 additions and 9 deletions

View file

@ -0,0 +1,29 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2017-05-25T17:56:48Z"
content="""
That looks like a git remote accessed perhaps by rsync, or perhaps locally?
I'd be surprised if a rsync transfer did this, because AFAIK all progress
updates come from rsync's own progress display, and that does not jump
backward.
Local file copies (when not using rsync), and some other types of remotes,
poll the size of the temp file to determine how much data has been
received, and so if the transfer doesn't resume, they will do this. **I've
made it avoid reporting the file size until the file size has changed once,
which avoids the problem in this case.**
Another way it could happen is when a transfer fails partway and git-annex
immediately retries and the retry fails to resume. In
this case, the progress would go to some percent for the first transfer,
and then could reset to a lower percent for the retry, and that
reflects what's really happening. Eg, 50% of it transferred and now
we've unfortunately started over at 0%.
I could make the reported progress always be monotonically increasing, but
then in that retry cases it would just seem to stall, perhaps for a long
period of time. Not sure that's better than a progress display that while
annoying, reflects what's really going on.
"""]]