Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
operations: fix goroutine leak in case of copy retry
Whenever transfer.Account() is called, a new goroutine acc.averageLoop() is started. This goroutine exits only when the channel acc.exit is closed. acc.exit is closed when acc.Done() is called, which happens during tr.Done(). However, if tr.Reset is called during a copy low level retry, it replaces the tr.acc, without calling acc.Done(), which results in the goroutine mentioned above never exiting. This commit calls acc.Done() during a tr.Reset()
- Loading branch information