diff --git a/server/cluster/cluster.go b/server/cluster/cluster.go index eb85b051ad1..7ab9e60a1e4 100644 --- a/server/cluster/cluster.go +++ b/server/cluster/cluster.go @@ -332,8 +332,12 @@ func (c *RaftCluster) Start(s Server) error { defer func() { // We need to try to stop tso jobs when the cluster is not running. // Ref: https://github.com/tikv/pd/issues/8836 - if !c.running { - c.stopTSOJobsIfNeeded() + if c.running { + return + } + if err := c.stopTSOJobsIfNeeded(); err != nil { + log.Error("failed to stop TSO jobs", errs.ZapError(err)) + return } }() failpoint.Inject("raftClusterReturn", func(val failpoint.Value) {