Fix Unit test fatal fail (#10933)

Signed-off-by: xiaofan-luan <xiaofan.luan@zilliz.com>
This commit is contained in:
Xiaofan 2021-10-30 10:24:38 +08:00 committed by GitHub
parent a53aee9f95
commit 2df2d488e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 7 deletions

View File

@ -317,7 +317,10 @@ func (s *Server) startServerLoop() {
s.startWatchService(s.serverLoopCtx) s.startWatchService(s.serverLoopCtx)
s.startFlushLoop(s.serverLoopCtx) s.startFlushLoop(s.serverLoopCtx)
go s.session.LivenessCheck(s.serverLoopCtx, func() { go s.session.LivenessCheck(s.serverLoopCtx, func() {
log.Fatal("Data Coord disconnected from etcd, process will exit", zap.Int64("Server Id", s.session.ServerID)) log.Error("Data Coord disconnected from etcd, process will exit", zap.Int64("Server Id", s.session.ServerID))
if err := s.Stop(); err != nil {
log.Fatal("failed to stop server", zap.Error(err))
}
}) })
} }

View File

@ -173,7 +173,10 @@ func (node *DataNode) Register() error {
go node.StartWatchChannels(node.ctx) go node.StartWatchChannels(node.ctx)
// Start liveness check // Start liveness check
go node.session.LivenessCheck(node.ctx, func() { go node.session.LivenessCheck(node.ctx, func() {
log.Fatal("Data Node disconnected from etcd, process will exit", zap.Int64("Server Id", node.session.ServerID)) log.Error("Data Node disconnected from etcd, process will exit", zap.Int64("Server Id", node.session.ServerID))
if err := node.Stop(); err != nil {
log.Fatal("failed to stop server", zap.Error(err))
}
}) })
Params.initMsgChannelSubName() Params.initMsgChannelSubName()

View File

@ -253,7 +253,10 @@ func (i *IndexCoord) Start() error {
go i.watchMetaLoop() go i.watchMetaLoop()
go i.session.LivenessCheck(i.loopCtx, func() { go i.session.LivenessCheck(i.loopCtx, func() {
log.Fatal("Index Coord disconnected from etcd, process will exit", zap.Int64("Server Id", i.session.ServerID)) log.Error("Index Coord disconnected from etcd, process will exit", zap.Int64("Server Id", i.session.ServerID))
if err := i.Stop(); err != nil {
log.Fatal("failed to stop server", zap.Error(err))
}
}) })
startErr = i.sched.Start() startErr = i.sched.Start()

View File

@ -185,7 +185,10 @@ func (i *IndexNode) Start() error {
//start liveness check //start liveness check
go i.session.LivenessCheck(i.loopCtx, func() { go i.session.LivenessCheck(i.loopCtx, func() {
log.Fatal("Index Node disconnected from etcd, process will exit", zap.Int64("Server Id", i.session.ServerID)) log.Error("Index Node disconnected from etcd, process will exit", zap.Int64("Server Id", i.session.ServerID))
if err := i.Stop(); err != nil {
log.Fatal("failed to stop server", zap.Error(err))
}
}) })
i.UpdateStateCode(internalpb.StateCode_Healthy) i.UpdateStateCode(internalpb.StateCode_Healthy)

View File

@ -109,7 +109,10 @@ func (node *Proxy) Register() error {
Params.SetLogger(Params.ProxyID) Params.SetLogger(Params.ProxyID)
Params.initProxySubName() Params.initProxySubName()
go node.session.LivenessCheck(node.ctx, func() { go node.session.LivenessCheck(node.ctx, func() {
log.Fatal("Proxy disconnected from etcd, process will exit", zap.Int64("Server Id", node.session.ServerID)) log.Error("Proxy disconnected from etcd, process will exit", zap.Int64("Server Id", node.session.ServerID))
if err := node.Stop(); err != nil {
log.Fatal("failed to stop server", zap.Error(err))
}
}) })
// TODO Reset the logger // TODO Reset the logger
//Params.initLogCfg() //Params.initLogCfg()

View File

@ -183,7 +183,10 @@ func (qc *QueryCoord) Start() error {
go qc.watchHandoffSegmentLoop() go qc.watchHandoffSegmentLoop()
go qc.session.LivenessCheck(qc.loopCtx, func() { go qc.session.LivenessCheck(qc.loopCtx, func() {
log.Fatal("Query Coord disconnected from etcd, process will exit", zap.Int64("Server Id", qc.session.ServerID)) log.Error("Query Coord disconnected from etcd, process will exit", zap.Int64("Server Id", qc.session.ServerID))
if err := qc.Stop(); err != nil {
log.Fatal("failed to stop server", zap.Error(err))
}
}) })
return nil return nil

View File

@ -118,7 +118,10 @@ func (node *QueryNode) Register() error {
node.session.Init(typeutil.QueryNodeRole, Params.QueryNodeIP+":"+strconv.FormatInt(Params.QueryNodePort, 10), false) node.session.Init(typeutil.QueryNodeRole, Params.QueryNodeIP+":"+strconv.FormatInt(Params.QueryNodePort, 10), false)
// start liveness check // start liveness check
go node.session.LivenessCheck(node.queryNodeLoopCtx, func() { go node.session.LivenessCheck(node.queryNodeLoopCtx, func() {
log.Fatal("Query Node disconnected from etcd, process will exit", zap.Int64("Server Id", node.session.ServerID)) log.Error("Query Node disconnected from etcd, process will exit", zap.Int64("Server Id", node.session.ServerID))
if err := node.Stop(); err != nil {
log.Fatal("failed to stop server", zap.Error(err))
}
}) })
Params.QueryNodeID = node.session.ServerID Params.QueryNodeID = node.session.ServerID

View File

@ -1103,6 +1103,9 @@ func (c *Core) Start() error {
go c.checkFlushedSegmentsLoop() go c.checkFlushedSegmentsLoop()
go c.session.LivenessCheck(c.ctx, func() { go c.session.LivenessCheck(c.ctx, func() {
log.Error("Root Coord disconnected from etcd, process will exit", zap.Int64("Server Id", c.session.ServerID)) log.Error("Root Coord disconnected from etcd, process will exit", zap.Int64("Server Id", c.session.ServerID))
if err := c.Stop(); err != nil {
log.Fatal("failed to stop server", zap.Error(err))
}
}) })
Params.CreatedTime = time.Now() Params.CreatedTime = time.Now()
Params.UpdatedTime = time.Now() Params.UpdatedTime = time.Now()