Skip to content

Commit

Permalink
mysql(ticdc): fix the data race in the conflict detector (#10630) (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Apr 16, 2024
1 parent 0d6a661 commit 3c4a12d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/causality/internal/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ func (n *Node) Remove() {
// It must be called if a node is no longer used.
// We are using sync.Pool to lessen the burden of GC.
func (n *Node) Free() {
n.mu.Lock()
defer n.mu.Unlock()
if n.id == invalidNodeID {
panic("double free")
}
Expand Down

0 comments on commit 3c4a12d

Please sign in to comment.