2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-23 05:12:10 +00:00
restic/internal/archiver
Michael Eischer debc4a3a99 archiver: fix race condition during worker startup
When the tomb is created with a canceled context, then the workers
started via `t.Go` exist nearly immediately. Once for the first time all
started goroutines have been stopped, it is not allowed to issue further
calls to `t.Go`. This is a problem when the started goroutines exit
immediately, as for example the first goroutine might already have
stopped before starting the second one, which is not allowed as once the
first goroutines has stopped no goroutines were running.

To fix this race condition the startup and main task of the archiver now
also run within a `t.Go` function. This also allows unifying the error
handling as it is no longer necessary to distinguish between errors
returned by the workers or the saveTree processing. The tomb now just
returns the first error encountered, which should also be the most
descriptive one.
2020-12-30 17:31:22 +01:00
..
archiver_test.go archiver: test that context canceled error is not dropped 2020-12-28 21:06:47 +01:00
archiver_unix_test.go archiver: Use untyped constants for testing FileInfo 2019-05-05 14:57:38 +02:00
archiver_windows_test.go archiver: Use untyped constants for testing FileInfo 2019-05-05 14:57:38 +02:00
archiver.go archiver: fix race condition during worker startup 2020-12-30 17:31:22 +01:00
blob_saver_test.go archiver: Remove unused variable from test 2020-09-05 10:07:16 +02:00
blob_saver.go Rename Index interface to MasterIndex 2020-07-25 21:19:46 +02:00
buffer.go archiver: Improve buffer pool 2018-04-30 15:13:28 +02:00
doc.go archiver: Add high-level documentation 2018-05-12 23:55:54 +02:00
file_saver_test.go archiver: Fix race condition triggered by TestArchiverAbortEarlyOnError 2020-04-13 18:23:17 +02:00
file_saver.go archiver: Fix race condition triggered by TestArchiverAbortEarlyOnError 2020-04-13 18:23:17 +02:00
scanner_test.go Remove a few redundant type specifiers 2020-10-06 14:55:13 +02:00
scanner.go Merge duplicated readdir functionality 2020-02-26 11:05:38 +01:00
testing_test.go Move internal/fs.TestChdir to internal/test.Chdir 2020-09-17 10:43:33 +02:00
testing.go Centralize buffer allocation and size checking in Repository.LoadBlob 2020-04-23 10:04:20 +02:00
tree_saver_test.go backup: Fix reporting of directory count in summary 2020-08-27 22:43:51 +02:00
tree_saver.go backup: Fix reporting of directory count in summary 2020-08-27 22:43:51 +02:00
tree_test.go Remove a few redundant type specifiers 2020-10-06 14:55:13 +02:00
tree.go Merge duplicated readdir functionality 2020-02-26 11:05:38 +01:00