restic/internal
Michael Eischer 8d0ba55ecd backup: Fix possible deadlock of scanner goroutine
When the backup is interrupted for some reason while the scanner is
still active this could lead to a deadlock. Interruptions are triggered
by canceling the context object used by both the backup progress UI and
the scanner. It is possible that a context is canceled between the
respective check in the scanner and it calling the `ReportTotal` method
of the UI. The latter method sends a message to the UI goroutine.
However, a canceled context will also stop that goroutine, which can
cause the channel send operation to block indefinitely.

This is resolved by adding a `closed` channel which is closed once the
UI goroutine is stopped and serves as an escape hatch for reported UI
updates.

This change covers not just the ReportTotal method but all potentially
affected methods of the progress UI implementation.
2020-09-30 23:13:10 +02:00
..
archiver Move internal/fs.TestChdir to internal/test.Chdir 2020-09-17 10:43:33 +02:00
backend Hide password from repository URLs 2020-09-22 22:00:51 +02:00
cache Make Cache.Path private 2020-09-18 11:17:29 +02:00
checker repository: Simplify worker group code 2020-09-05 10:07:16 +02:00
crypto crypto: Remove unused error 2020-09-05 10:07:16 +02:00
debug Remove build tag release 2018-10-11 19:40:38 +02:00
dump Move internal/fs.TestChdir to internal/test.Chdir 2020-09-17 10:43:33 +02:00
errors backup: Improve error message for invalid pattern 2018-10-03 11:12:51 +02:00
filter filter: Allow double wildcard in ChildMatch 2018-06-09 23:18:13 +02:00
fs Simplify os.ModeType|os.ModeCharDevice => os.ModeType 2020-09-21 14:21:32 +02:00
fuse Merge a few variable declaration and initializations 2020-09-05 10:05:34 +02:00
hashing Micro-optimization for hashing.Writer/PackerManager 2020-03-05 22:30:04 +01:00
index Use "pack file" instead of "data file" (#2885) 2020-08-16 11:16:38 +02:00
limiter rclone: Respect bandwith limits 2018-05-22 20:48:17 +02:00
migrations Use "pack file" instead of "data file" (#2885) 2020-08-16 11:16:38 +02:00
mock mock: Remove unused repository type 2019-04-13 13:38:39 +02:00
options options: Fix test for Go >= 1.15 2020-09-12 17:36:44 +02:00
pack Use "pack file" instead of "data file" (#2885) 2020-08-16 11:16:38 +02:00
repository init: Add --copy-chunker-params option 2020-09-19 16:53:05 +02:00
restic Remove restic.Cache interface 2020-09-18 10:48:13 +02:00
restorer Move internal/fs.TestChdir to internal/test.Chdir 2020-09-17 10:43:33 +02:00
selfupdate self-update: Don't cancel download after 30 seconds 2019-02-23 11:15:18 +01:00
test Move internal/fs.TestChdir to internal/test.Chdir 2020-09-17 10:43:33 +02:00
textfile Remove io.Writer from fs.File 2020-09-21 14:21:32 +02:00
ui backup: Fix possible deadlock of scanner goroutine 2020-09-30 23:13:10 +02:00
walker error variable names should start with 'Err' 2020-09-05 10:07:17 +02:00