diff --git a/pkg/causality/internal/node.go b/pkg/causality/internal/node.go index 34d7574ea78..2d411f959fd 100644 --- a/pkg/causality/internal/node.go +++ b/pkg/causality/internal/node.go @@ -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") }