After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779569 - Skipped files count for transfer rate
Skipped files count for transfer rate
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: File and Folder Operations
3.22.x
Other Linux
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 652218 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-03-04 12:22 UTC by Frank
Modified: 2017-03-06 12:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
file-operations: change skip behavior (2.90 KB, patch)
2017-03-04 12:53 UTC, Ernestas Kulik
none Details | Review
file-operations: unset skipped_file on copy/move (902 bytes, patch)
2017-03-05 13:53 UTC, Ernestas Kulik
none Details | Review
file-operations: change skip behavior (2.90 KB, patch)
2017-03-05 13:57 UTC, Ernestas Kulik
none Details | Review
file-operations: reset skipped status of files on copy/move (1.08 KB, patch)
2017-03-06 12:39 UTC, Ernestas Kulik
committed Details | Review
file-operations: change skip behavior (2.90 KB, patch)
2017-03-06 12:39 UTC, Ernestas Kulik
committed Details | Review

Description Frank 2017-03-04 12:22:18 UTC
When copying data and selecting "skip already existing files" the file sizes of the skipped files influence the transfer rate shown in this small popup. But only actual transferred data should count.

In my case of copying a folder, a lot of files were already present, so just few files still had to merged/transferred. I was shown a (with time decreasing) rate of ~10 GB/s instead of the real ~20 MB/s.

I'm running Nautilus 3.22.2 on Debian Testing.
Comment 1 Ernestas Kulik 2017-03-04 12:53:42 UTC
Created attachment 347202 [details] [review]
file-operations: change skip behavior

Currently, when skipping files, they are added to the transfer counts,
which results in inflated progress information. This commit reverses the
behavior to remove from source counts.
Comment 2 Frank 2017-03-04 12:55:46 UTC
Oh that was quick, thanks a lot! :)
Comment 3 Frank 2017-03-04 13:51:41 UTC
I recognized a further bug in the exact same (still enduring) operation:

File count in the same popup now shows me 1124/1081 files, the pie symbol is almost full and no transfer rate is shown – but still many files are missing (transfer still continues). So I assume that skipped files somehow lead to this overflow. Can you ore someone else take a look at this, please?
Comment 4 Ernestas Kulik 2017-03-04 16:18:46 UTC
(In reply to Frank from comment #3)
> I recognized a further bug in the exact same (still enduring) operation:
> 
> File count in the same popup now shows me 1124/1081 files, the pie symbol is
> almost full and no transfer rate is shown – but still many files are missing
> (transfer still continues). So I assume that skipped files somehow lead to
> this overflow. Can you ore someone else take a look at this, please?

With how it’s handled currently, I can only think of a scenario, where it would be 1081/1124 with all the operations finished (oops), but not an overflow like you describe.

I think it’s a specific configuration of files and folders that are skipped or merged that leads to this, but I can’t work it out yet.
Comment 5 Frank 2017-03-04 16:34:31 UTC
My folder contains 1081 binary data files. After skipping ~800 already copied files, the merge operation jumped to ~801/1081 at which the first file was actually transferred, but it counted beyond 1081. It finished at 1177/1081. So I have the feeling that maybe the jump to 801 was too far, or some files were counted wrongly (maybe because already existing files, or maybe folders were counted on the left side, while on the right side the 1081 files just describe data files)?
Comment 6 Ernestas Kulik 2017-03-04 16:46:05 UTC
(In reply to Frank from comment #5)
> My folder contains 1081 binary data files. After skipping ~800 already
> copied files, the merge operation jumped to ~801/1081 at which the first
> file was actually transferred, but it counted beyond 1081.

It could be that somehow the file count in the folder is off (unless you know that the number is correct). Sounds like a separate issue. *shrug*

> It finished at 1177/1081. So I have the feeling that maybe the jump to 801 was
> too far, or some files were counted wrongly (maybe because already existing
> files, or maybe folders were counted on the left side, while on the right side
> the 1081 files just describe data files)?

No, folders just add +1 to the count on both sides, IIRC.

No promises yet, but I’ll give it another try.
Comment 7 Frank 2017-03-04 18:07:47 UTC
Should I open another bug report for this issue?

The overall folder contains 902 Objects (as Ctrl + I tells me), the missing 179 files seem to be folders.
Comment 8 Ernestas Kulik 2017-03-04 18:41:35 UTC
(In reply to Frank from comment #7)
> Should I open another bug report for this issue?
> 
> The overall folder contains 902 Objects (as Ctrl + I tells me), the missing
> 179 files seem to be folders.

Let’s keep it here for now, since we’re not sure what’s causing this.
Comment 9 Ernestas Kulik 2017-03-04 19:34:59 UTC
Aha! I’m able to reproduce it as well.
Comment 10 Ernestas Kulik 2017-03-04 19:43:08 UTC
If you merge directories, but skip all conflicting files, the code starts skipping the files that aren’t conflicting as well.
Comment 11 Frank 2017-03-04 19:47:27 UTC
Cool! Aaand I just discovered a third bug with skipping files at copying… :P

I copied several folders from one drive to another, but one of the folders was there already. At being asked to skip or re-copy, I chose skip and now the progress remains at 3.859/4.396 with the bar being at the corresponding percentage – but there is no abort button, but instead the checkmark for accomplished transfers, because the transfer is complete.

So the 537 Objects of the skipped folder aren't counted, and secondly, this behaviour is contradictorily and should be prohibited.
Comment 12 Frank 2017-03-04 19:49:40 UTC
Not quite sure if this is due to the same behaviour you described, but anyways, the checkmark must not coexist with a non-complete progress, if you ask me.
Comment 13 Frank 2017-03-04 19:55:59 UTC
And there is no way to get rid of this status popup…
Comment 14 Ernestas Kulik 2017-03-05 13:53:23 UTC
Created attachment 347264 [details] [review]
file-operations: unset skipped_file on copy/move

copy_move_file () does not set skipped_file to FALSE explicitly, which
results in broken progress information due to callers not resetting the
variable.
Comment 15 Ernestas Kulik 2017-03-05 13:57:04 UTC
Created attachment 347265 [details] [review]
file-operations: change skip behavior

Currently, when skipping files, they are added to the transfer counts,
which results in inflated progress information. This commit reverses the
behavior to remove from source counts.
Comment 16 Ernestas Kulik 2017-03-05 14:00:48 UTC
(In reply to Frank from comment #11)
> Cool! Aaand I just discovered a third bug with skipping files at copying… :P
> 
> I copied several folders from one drive to another, but one of the folders
> was there already. At being asked to skip or re-copy, I chose skip and now
> the progress remains at 3.859/4.396 with the bar being at the corresponding
> percentage – but there is no abort button, but instead the checkmark for
> accomplished transfers, because the transfer is complete.
> 
> So the 537 Objects of the skipped folder aren't counted, and secondly, this
> behaviour is contradictorily and should be prohibited.

Yup, this is what I mentioned before.

The two patches I’ve attached should fix all of the issues described here.
Comment 17 Frank 2017-03-05 21:53:11 UTC
Many thanks Ernestas!
Comment 18 Carlos Soriano 2017-03-06 12:15:00 UTC
Review of attachment 347264 [details] [review]:

Heya, thanks for the patch! silly mistake, I wonder when I introduced it :/

Don't use variable names and C code in commit messages, use English:
"When copying a file we weren't setting properly whether it was skipped or not"
Comment 19 Carlos Soriano 2017-03-06 12:17:47 UTC
Review of attachment 347265 [details] [review]:

Thanks for the patch! The UX of that is meh, but it's a right fix for now. Good thing to keep in the TODO list for the GSoC project about operations.

In the commit message, if you mention "reverse" you should mention from where (commit id in this case). Here you can just "This commit subtract them from the total operation instead of adding to the transfer count" Feel free to commit after changing this to any of the cases.
Comment 20 Carlos Soriano 2017-03-06 12:18:14 UTC
Review of attachment 347264 [details] [review]:

This one is also feel free to commit after changing the message.
Comment 21 Ernestas Kulik 2017-03-06 12:39:30 UTC
Created attachment 347306 [details] [review]
file-operations: reset skipped status of files on copy/move

When copying or moving a file, the file’s “skipped” status is not reset,
resulting in cases where the code starts skipping all files. In such
cases the progress popover will show the finished operation count higher
than the total amount of files.
Comment 22 Ernestas Kulik 2017-03-06 12:39:40 UTC
Created attachment 347307 [details] [review]
file-operations: change skip behavior

Currently, when skipping files, they are added to the transfer counts,
which results in inflated progress information. This commit makes the
code subtract from the total counts, instead.
Comment 23 Ernestas Kulik 2017-03-06 12:40:45 UTC
Attachment 347306 [details] pushed as b5ebb70 - file-operations: reset skipped status of files on copy/move
Attachment 347307 [details] pushed as f80af50 - file-operations: change skip behavior
Comment 24 Daniel Boles 2017-03-06 12:55:30 UTC
*** Bug 652218 has been marked as a duplicate of this bug. ***