mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
Add log with context in DataCoord (#14431)
Signed-off-by: sunby <bingyi.sun@zilliz.com> Co-authored-by: sunby <bingyi.sun@zilliz.com>
This commit is contained in:
parent
b4a04a36ab
commit
02e568603b
@ -210,8 +210,10 @@ func (mr *MilvusRoles) runDataCoord(ctx context.Context, localMsg bool) *compone
|
||||
f := setLoggerFunc()
|
||||
datacoord.Params.BaseParams.SetLogConfig(f)
|
||||
factory := newMsgFactory(localMsg)
|
||||
|
||||
dctx := logutil.WithModule(ctx, "DataCoord")
|
||||
var err error
|
||||
ds, err = components.NewDataCoord(ctx, factory)
|
||||
ds, err = components.NewDataCoord(dctx, factory)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@ -214,9 +214,9 @@ func (s *Server) QuitSignal() <-chan struct{} {
|
||||
func (s *Server) Register() error {
|
||||
s.session.Register()
|
||||
go s.session.LivenessCheck(s.serverLoopCtx, func() {
|
||||
log.Error("DataCoord disconnected from etcd and exited", zap.Int64("ServerID", s.session.ServerID))
|
||||
logutil.Logger(s.ctx).Error("disconnected from etcd and exited", zap.Int64("serverID", s.session.ServerID))
|
||||
if err := s.Stop(); err != nil {
|
||||
log.Fatal("failed to stop server", zap.Error(err))
|
||||
logutil.Logger(s.ctx).Fatal("failed to stop server", zap.Error(err))
|
||||
}
|
||||
// manually send signal to starter goroutine
|
||||
syscall.Kill(syscall.Getpid(), syscall.SIGINT)
|
||||
@ -291,7 +291,7 @@ func (s *Server) Start() error {
|
||||
Params.DataCoordCfg.CreatedTime = time.Now()
|
||||
Params.DataCoordCfg.UpdatedTime = time.Now()
|
||||
atomic.StoreInt64(&s.isServing, ServerStateHealthy)
|
||||
log.Debug("DataCoord startup success")
|
||||
logutil.Logger(s.ctx).Debug("startup success")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user