Skip to content

Commit

Permalink
txn: fix goroutine leak (#784)
Browse files Browse the repository at this point in the history
Signed-off-by: disksing <[email protected]>
  • Loading branch information
disksing authored Apr 27, 2023
1 parent c619a50 commit aee2f31
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions txnkv/transaction/txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,9 @@ func (txn *KVTxn) asyncPessimisticRollback(ctx context.Context, keys [][]byte, s
}
wg := new(sync.WaitGroup)
wg.Add(1)
txn.store.WaitGroup().Add(1)
go func() {
defer txn.store.WaitGroup().Done()
if val, err := util.EvalFailpoint("beforeAsyncPessimisticRollback"); err == nil {
if s, ok := val.(string); ok {
if s == "skip" {
Expand Down

0 comments on commit aee2f31

Please sign in to comment.