File tree 3 files changed +18
-3
lines changed
3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -743,6 +743,9 @@ func (client *txnClient) removeFromWaitActiveLocked(txnID []byte) bool {
743
743
744
744
func (client * txnClient ) waitMarkAllActiveAbortedLocked () {
745
745
if client .mu .waitMarkAllActiveAbortedC != nil {
746
- <- client .mu .waitMarkAllActiveAbortedC
746
+ c := client .mu .waitMarkAllActiveAbortedC
747
+ client .mu .Unlock ()
748
+ <- c
749
+ client .mu .Lock ()
747
750
}
748
751
}
Original file line number Diff line number Diff line change @@ -275,3 +275,16 @@ func TestNewWithUpdateSnapshotTimeout(t *testing.T) {
275
275
assert .Equal (t , 0 , len (v .mu .waitActiveTxns ))
276
276
v .mu .Unlock ()
277
277
}
278
+
279
+ func TestWaitAbortMarked (t * testing.T ) {
280
+ c := make (chan struct {})
281
+ tc := & txnClient {}
282
+ tc .mu .waitMarkAllActiveAbortedC = c
283
+ tc .mu .state = normal
284
+ tc .mu .activeTxns = map [string ]* txnOperator {}
285
+ go func () {
286
+ close (c )
287
+ }()
288
+ op := & txnOperator {}
289
+ require .NoError (t , tc .openTxn (op ))
290
+ }
Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ import (
24
24
"sync/atomic"
25
25
"time"
26
26
27
- "go.uber.org/zap"
28
-
29
27
"github.com/matrixorigin/matrixone/pkg/common/log"
30
28
"github.com/matrixorigin/matrixone/pkg/common/moerr"
31
29
"github.com/matrixorigin/matrixone/pkg/common/runtime"
@@ -38,6 +36,7 @@ import (
38
36
"github.com/matrixorigin/matrixone/pkg/txn/rpc"
39
37
"github.com/matrixorigin/matrixone/pkg/txn/util"
40
38
v2 "github.com/matrixorigin/matrixone/pkg/util/metric/v2"
39
+ "go.uber.org/zap"
41
40
)
42
41
43
42
var (
You can’t perform that action at this time.
0 commit comments