mirror of https://github.com/milvus-io/milvus.git
Fix `sessions` concurrency problem (#20140)
Signed-off-by: SimFG <bang.fu@zilliz.com> Signed-off-by: SimFG <bang.fu@zilliz.com>pull/20142/head
parent
d00028edba
commit
a90e28cf45
|
@ -237,13 +237,11 @@ func (c *SessionManager) execReCollectSegmentStats(ctx context.Context, nodeID i
|
|||
func (c *SessionManager) GetCompactionState() map[int64]*datapb.CompactionStateResult {
|
||||
wg := sync.WaitGroup{}
|
||||
ctx := context.Background()
|
||||
c.sessions.RLock()
|
||||
wg.Add(len(c.sessions.data))
|
||||
c.sessions.RUnlock()
|
||||
|
||||
plans := sync.Map{}
|
||||
c.sessions.RLock()
|
||||
for nodeID, s := range c.sessions.data {
|
||||
wg.Add(1)
|
||||
go func(nodeID int64, s *Session) {
|
||||
defer wg.Done()
|
||||
cli, err := s.GetOrCreateClient(ctx)
|
||||
|
|
Loading…
Reference in New Issue