From bccbd0ef92dcffec775e5deb187fb91f41c71f28 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 11 Mar 2021 11:46:23 +1100 Subject: Remove retry profiles on Tx recycle This may fix a memory leak where the *Tx in retry profile keys holds on to old Tx and their writes. --- tx.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tx.go') diff --git a/tx.go b/tx.go index 8f70c1b..9be08b5 100644 --- a/tx.go +++ b/tx.go @@ -145,6 +145,9 @@ func (tx *Tx) recycle() { delete(tx.watching, v) v.watchers.Delete(tx) } + tx.removeRetryProfiles() + // I don't think we can reuse Txs, because the "completed" field should/needs to be set + // indefinitely after use. //txPool.Put(tx) } -- cgit v1.2.3