"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
accounting: fix goroutine leak in ResetCounters
Nick Craig-Wooda8f102ce8f78
diff --git a/fs/accounting/stats.go b/fs/accounting/stats.goindex 41d0462e3..8dc14f236 100644--- a/fs/accounting/stats.go+++ b/fs/accounting/stats.go@@ -730,9 +730,15 @@ func (s *StatsInfo) ResetCounters() {s.startedTransfers = nils.oldDuration = 0+ // Only restart the average loop if it was running. Otherwise+ // ResetCounters would spawn a goroutine that pins the StatsInfo,+ // leaking memory when called on stats that never started the loop.+ wasStarted := s.average.starteds._stopAverageLoop()s.average = averageValues{}- s._startAverageLoop()+ if wasStarted {+ s._startAverageLoop()+ }}// ResetErrors sets the errors count to 0 and resets lastError, fatalError and retryError