Update rootcoord state to unhealthy before stopping (#12845)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/12847/head
congqixia 2021-12-07 18:39:03 +08:00 committed by GitHub
parent ad4c808207
commit e4de86ba42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1180,7 +1180,7 @@ func (c *Core) Start() error {
Params.CreatedTime = time.Now()
Params.UpdatedTime = time.Now()
c.stateCode.Store(internalpb.StateCode_Healthy)
c.UpdateStateCode(internalpb.StateCode_Healthy)
log.Debug(typeutil.RootCoordRole+" start successfully ", zap.String("State Code", internalpb.StateCode_name[int32(internalpb.StateCode_Healthy)]))
})
@ -1189,9 +1189,10 @@ func (c *Core) Start() error {
// Stop stop rootcoord
func (c *Core) Stop() error {
c.UpdateStateCode(internalpb.StateCode_Abnormal)
c.cancel()
c.wg.Wait()
c.stateCode.Store(internalpb.StateCode_Abnormal)
// wait at most one second to revoke
c.session.Revoke(time.Second)
return nil