Skip to content

Commit

Permalink
Fix rootcoord goroutine leak (milvus-io#16071)
Browse files Browse the repository at this point in the history
issue: milvus-io#15658
Signed-off-by: sunby <[email protected]>

Co-authored-by: sunby <[email protected]>
  • Loading branch information
sunby and sunby authored Mar 16, 2022
1 parent 2047209 commit 256ccb8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/mq/msgstream/mq_msgstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,6 @@ func (ms *mqMsgStream) Start() {
}

func (ms *mqMsgStream) Close() {
if !atomic.CompareAndSwapInt32(&ms.closed, 0, 1) {
return
}
ms.streamCancel()
ms.wait.Wait()

Expand All @@ -204,6 +201,10 @@ func (ms *mqMsgStream) Close() {
}

ms.client.Close()

if !atomic.CompareAndSwapInt32(&ms.closed, 0, 1) {
return
}
close(ms.receiveBuf)
}

Expand Down

0 comments on commit 256ccb8

Please sign in to comment.