Fix rootcoord goroutine leak (#16071)

issue: #15658
Signed-off-by: sunby <bingyi.sun@zilliz.com>

Co-authored-by: sunby <bingyi.sun@zilliz.com>
pull/16080/head
Bingyi Sun 2022-03-16 16:47:21 +08:00 committed by GitHub
parent 2047209d9e
commit 256ccb8f65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -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()
@ -204,6 +201,10 @@ func (ms *mqMsgStream) Close() {
}
ms.client.Close()
if !atomic.CompareAndSwapInt32(&ms.closed, 0, 1) {
return
}
close(ms.receiveBuf)
}