You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
During scanning, there is incorrect 0% suffix being shown on label #8331
Problem is visibile on both syncthing 1.19.1 and syncthing 1.20.1 - I dont know about earlier releases.
Firefox 100
Problem description:
During scanning the "Scanning" label has also "0%" suffix being shown which is incorrect/misleading. AFAIK this 0% does not apply to scanning. There is never anything bigger than 0% on scanning. Also sometimes there is just "Scanning"
I would expect that either Scanning never shows 0%, only "Scanning", or the percentage increases as folder is being scanned.
To reproduce it, you need to have folder with big number of files (100k+) as for small one label changeing is too fast to notice.
I can confirm the "0%" problem. Scanning seems to show the actual percentage only when going through new files, but if you rescan already existing ones, it just says "Scanning" with no percentage or, not sure when exactly though, it sometimes gets stuck at "Scanning (0%)".
Set to the default value of 0 (meaning 2 seconds). I've just managed to reproduce the issue.
Set up a shared folder with quite a large number of files between two devices.
On Device 2, pause all folders, then restart Syncthing (to clear cache).
On Device 1, make a change in the folder while it's still paused on Device 2.
On Device 2, unpause the folder.
Firstly, the label says only "Scanning", but then it changes to "Scanning (0%)", and it stays like that for ~5 seconds.
Next, the label for a very brief moment changes to "Out of Sync", which then immediately changes into "Up to Date".
I'm not sure what exactly is going on behind the scenes, but as it looks in the GUI, the label seems to change directly from "Scanning" to "Scanning (0%)", and then straight into "Out of Sync", and only then into "Up to Date". It also sits at "Scanning (0%)" for at least a few seconds even if there's nothing new to hash (e.g. when syncing a deletion). The percentage itself is stuck at "0%" all the time.
So there was nothing to hash, and it's taking a few seconds to finish up that phase (looking for deleted files) and emitting events to the GUI. This seems like an insignificant UI detail. It could say "100%" for those few seconds as well, but I guess that would also be wrong because it's still doing something?
Just curious, how is the percentage calculated here exactly? Let's say, we've added 5 new files to the folder. When hashing the first file, will it be calculated out of the 5 newly added files (i.e. 20%) or out of the total number of files in the folder? If it's the latter, then this may be the reason why it always stays at 0%, since it's usually just a few files out of 10,000 or similar.
Of course, I haven't really examined the code, so I may be completely wrong.
On my (slow) machines, with big folders (read hours of scanning(*)), I never saw any value different than 0% on Scanning. Either just "Scanning" either "Scanning (0%)". If changing to match actuall progress is difficult I suggest to ditch the number as it's misleading.
Option scanProgressIntervalS is at 0 (default).
(*) it was few dozens of hours (+1 day) of scanning due to highly ineffective CaseSensitivity check, which also being executed on Scanning, after disabling it, Scanning takes around 11 minutes on that machine. but thats another story :)
Activity
tomasz1986 commentedon May 8, 2022
I can confirm the "0%" problem. Scanning seems to show the actual percentage only when going through new files, but if you rescan already existing ones, it just says "Scanning" with no percentage or, not sure when exactly though, it sometimes gets stuck at "Scanning (0%)".
calmh commentedon May 8, 2022
scanProgressIntervalS?Every scan has two phases.
tomasz1986 commentedon May 8, 2022
Set to the default value of
0(meaning 2 seconds). I've just managed to reproduce the issue.Set up a shared folder with quite a large number of files between two devices.
On Device 2, pause all folders, then restart Syncthing (to clear cache).
On Device 1, make a change in the folder while it's still paused on Device 2.
On Device 2, unpause the folder.
Firstly, the label says only "Scanning", but then it changes to "Scanning (0%)", and it stays like that for ~5 seconds.
Next, the label for a very brief moment changes to "Out of Sync", which then immediately changes into "Up to Date".
I'm not sure what exactly is going on behind the scenes, but as it looks in the GUI, the label seems to change directly from "Scanning" to "Scanning (0%)", and then straight into "Out of Sync", and only then into "Up to Date". It also sits at "Scanning (0%)" for at least a few seconds even if there's nothing new to hash (e.g. when syncing a deletion). The percentage itself is stuck at "0%" all the time.
calmh commentedon May 8, 2022
So there was nothing to hash, and it's taking a few seconds to finish up that phase (looking for deleted files) and emitting events to the GUI. This seems like an insignificant UI detail. It could say "100%" for those few seconds as well, but I guess that would also be wrong because it's still doing something?
tomasz1986 commentedon May 8, 2022
Just curious, how is the percentage calculated here exactly? Let's say, we've added 5 new files to the folder. When hashing the first file, will it be calculated out of the 5 newly added files (i.e. 20%) or out of the total number of files in the folder? If it's the latter, then this may be the reason why it always stays at 0%, since it's usually just a few files out of 10,000 or similar.
Of course, I haven't really examined the code, so I may be completely wrong.
calmh commentedon May 8, 2022
Bytes scanned out of bytes to scan.
syncthing/gui/default/syncthing/core/syncthingController.js
Lines 997 to 1003 in 235422c
rdslw commentedon May 9, 2022
On my (slow) machines, with big folders (read hours of scanning(*)), I never saw any value different than 0% on Scanning. Either just "Scanning" either "Scanning (0%)". If changing to match actuall progress is difficult I suggest to ditch the number as it's misleading.
Option scanProgressIntervalS is at 0 (default).
(*) it was few dozens of hours (+1 day) of scanning due to highly ineffective CaseSensitivity check, which also being executed on Scanning, after disabling it, Scanning takes around 11 minutes on that machine. but thats another story :)
gui, lib/scanner: Improve scan progress indication (ref syncthing#8331)
gui, lib/scanner: Improve scan progress indication (ref #8331) (#9308)
Merge branch 'main' into tokensdb
Merge branch 'main' into cli_completion
Merge branch 'main' into integrationtests