rclone/fs/accounting
Nick Craig-Wood ae3c73f610 stats: fix race between ResetCounters and stopAverageLoop called from time.AfterFunc
Before this change StatsInfo.ResetCounters() and stopAverageLoop()
(when called from time.AfterFunc) could race on StatsInfo.average.
This was because the deferred stopAverageLoop accessed
StatsInfo.average without locking.

For some reason this only ever happened on macOS. This caused the CI
to fail on macOS thus causing the macOS builds not to appear.

This commit fixes the problem with a bit of extra locking.

It also renames all StatsInfo methods that should be called without
the lock to start with an initial underscore as this is the convention
we use elsewhere.

Fixes #7567
2024-01-17 10:23:50 +00:00
..
accounting_other.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
accounting_test.go Replace deprecated ioutil 2022-11-07 11:41:47 +00:00
accounting_unix.go accounting: bwlimit signal handler should always start 2023-06-22 17:59:24 +01:00
accounting.go accounting: fix stats to show server side transfers 2024-01-07 11:26:09 +00:00
inprogress.go fs: deglobalise the config #4685 2020-11-26 16:40:12 +00:00
prometheus.go stats: fix race between ResetCounters and stopAverageLoop called from time.AfterFunc 2024-01-17 10:23:50 +00:00
stats_groups_test.go fs: fix race conditions in --max-delete and --max-delete-size 2023-03-09 09:25:31 +00:00
stats_groups.go accounting: show server side stats in own lines and not as bytes transferred 2023-08-05 03:54:01 +01:00
stats_test.go stats: fix race between ResetCounters and stopAverageLoop called from time.AfterFunc 2024-01-17 10:23:50 +00:00
stats.go stats: fix race between ResetCounters and stopAverageLoop called from time.AfterFunc 2024-01-17 10:23:50 +00:00
token_bucket_test.go Use binary prefixes for size and rate units 2021-04-27 02:25:52 +03:00
token_bucket.go accounting: bwlimit signal handler should always start 2023-06-22 17:59:24 +01:00
tpslimit_test.go fs/accounting: fix occasionally failing test on macOS 2021-02-07 14:59:53 +00:00
tpslimit.go accounting: factor --tpslimit code into accounting from fshttp 2021-01-08 10:29:57 +00:00
transfer.go accounting: fix stats to show server side transfers 2024-01-07 11:26:09 +00:00
transfermap.go accounting: show checking tag if available even on transfers 2023-03-01 11:10:38 +00:00