Skip to content

Commit

Permalink
cluster: avoid unexpect scheduling job start
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Nov 8, 2024
1 parent c9e532c commit 80c98e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,13 @@ func (c *RaftCluster) runServiceCheckJob() {
log.Info("service check job is stopped")
return
case <-schedulingTicker.C:
c.checkSchedulingService()
// ensure raft cluster is running
// avoid unexpected startSchedulingJobs when raft cluster is stopping
c.RLock()
if c.running {
c.checkSchedulingService()
}
c.RUnlock()
case <-tsoTicker.C:
// ensure raft cluster is running
// avoid unexpected startTSOJobsIfNeeded when raft cluster is stopping
Expand Down

0 comments on commit 80c98e1

Please sign in to comment.