syncthing/cmd
Jakob Borg d6fbfc3545 lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965)
The folder already knew how to stop properly, but the fs.Walk() didn't
and can potentially take a very long time. This adds context support to
Walk and the underlying scanning stuff, and passes in an appropriate
context from above. The stop channel in model.folder is replaced with a
context for this purpose.

To test I added an infiniteFS that represents a large amount of data
(not actually infinite, but close) and verify that walking it is
properly stopped. For that to be implemented smoothly I moved out the
Walk function to it's own type, as typically the implementer of a new
filesystem type might not need or want to reimplement Walk.

It's somewhat tricky to test that this actually works properly on the
actual sendReceiveFolder and so on, as those are started from inside the
model and the filesystem isn't easily pluggable etc. Instead I've tested
that part manually by adding a huge folder and verifying that pause,
resume and reconfig do the right things by looking at debug output.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4117
2017-04-26 00:15:23 +00:00
..
stbench all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stcli all: Weed out a few other http urls (ref #3976) 2017-02-09 08:04:16 +01:00
stcompdirs all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stdisco all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stdiscosrv all: Weed out a few other http urls (ref #3976) 2017-02-09 08:04:16 +01:00
stevents all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stfileinfo lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00
stfinddevice all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stgenfiles all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stindex all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
strelaypoolsrv all: Correct various typos 2017-02-25 08:12:13 +00:00
strelaysrv all: Correct various typos 2017-02-25 08:12:13 +00:00
stsigtool all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stvanity all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
stwatchfile all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
syncthing lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00
todos all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
.gitignore Remove reprecated st* utils 2014-07-01 12:20:25 +02:00