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 <admin@liudos.us>
  • Loading branch information
lhy1024 authored and ti-chi-bot committed Nov 8, 2024
1 parent 051907b commit c562505
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 @@ -459,7 +459,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 c562505

Please sign in to comment.