未验证 提交 a960cc2a 编写于 作者: C congqixia 提交者: GitHub

Fix data race in pipeline/manager (#24127)

Signed-off-by: NCongqi Xia <congqi.xia@zilliz.com>
上级 74bba232
......@@ -49,10 +49,12 @@ type manager struct {
tSafeManager TSafeManager
dispatcher msgdispatcher.Client
mu sync.Mutex
mu sync.RWMutex
}
func (m *manager) Num() int {
m.mu.RLock()
defer m.mu.RUnlock()
return len(m.channel2Pipeline)
}
......@@ -162,6 +164,5 @@ func NewManager(dataManager *DataManager,
delegators: delegators,
tSafeManager: tSafeManager,
dispatcher: dispatcher,
mu: sync.Mutex{},
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册