mirror of https://github.com/milvus-io/milvus.git
Proxy exit when disconnected to etcd (#13180)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>pull/13213/head
parent
3f0970153c
commit
175f3147d0
|
@ -22,6 +22,7 @@ import (
|
|||
"math/rand"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/util/metricsinfo"
|
||||
|
@ -118,6 +119,7 @@ func (node *Proxy) Register() error {
|
|||
if err := node.Stop(); err != nil {
|
||||
log.Fatal("failed to stop server", zap.Error(err))
|
||||
}
|
||||
syscall.Kill(syscall.Getpid(), syscall.SIGINT)
|
||||
})
|
||||
// TODO Reset the logger
|
||||
//Params.initLogCfg()
|
||||
|
@ -347,18 +349,25 @@ func (node *Proxy) Stop() error {
|
|||
|
||||
if node.idAllocator != nil {
|
||||
node.idAllocator.Close()
|
||||
log.Info("close id allocator", zap.String("role", Params.RoleName))
|
||||
}
|
||||
|
||||
if node.segAssigner != nil {
|
||||
node.segAssigner.Close()
|
||||
log.Info("close segment id assigner", zap.String("role", Params.RoleName))
|
||||
}
|
||||
|
||||
if node.sched != nil {
|
||||
node.sched.Close()
|
||||
log.Info("close scheduler", zap.String("role", Params.RoleName))
|
||||
}
|
||||
|
||||
if node.chTicker != nil {
|
||||
err := node.chTicker.close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Info("close channels time ticker", zap.String("role", Params.RoleName))
|
||||
}
|
||||
|
||||
node.wg.Wait()
|
||||
|
|
Loading…
Reference in New Issue