mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-29 18:38:44 +08:00
Fix querycoord panic when stop nil conn of querynoClient (#7346)
Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
parent
cc99bae250
commit
af574d17d5
@ -127,7 +127,11 @@ func (c *Client) Start() error {
|
||||
}
|
||||
|
||||
func (c *Client) Stop() error {
|
||||
return c.conn.Close()
|
||||
c.cancel()
|
||||
if c.conn != nil {
|
||||
c.conn.Close()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Register dummy
|
||||
|
15
internal/distributed/querynode/client/client_test.go
Normal file
15
internal/distributed/querynode/client/client_test.go
Normal file
@ -0,0 +1,15 @@
|
||||
package grpcquerynodeclient
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestNilClient(t *testing.T) {
|
||||
client, err := NewClient(context.Background(), "test")
|
||||
assert.Nil(t, err)
|
||||
err = client.Stop()
|
||||
assert.Nil(t, err)
|
||||
}
|
Loading…
Reference in New Issue
Block a user