syncthing/lib/fs
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
..
basicfs_symlink_unix.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
basicfs_symlink_windows.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
basicfs.go lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00
filesystem.go lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00
lstat_broken.go lib/scanner: Use fs.Filesystem for all operations 2017-04-01 09:04:11 +00:00
lstat_regular.go lib/scanner: Use fs.Filesystem for all operations 2017-04-01 09:04:11 +00:00
mtimefs_test.go lib/scanner: Use fs.Filesystem for all operations 2017-04-01 09:04:11 +00:00
mtimefs.go lib/scanner: Use fs.Filesystem for all operations 2017-04-01 09:04:11 +00:00
walkfs.go lib/fs, lib/model, lib/scanner: Make scans cancellable (fixes #3965) 2017-04-26 00:15:23 +00:00