Skip to content

Commit

Permalink
cluster: avoid unexpect scheduling job start (#8794) (#8796)
Browse files Browse the repository at this point in the history
ref #8781

Signed-off-by: lhy1024 <[email protected]>

Co-authored-by: lhy1024 <[email protected]>
  • Loading branch information
ti-chi-bot and lhy1024 authored Nov 8, 2024
1 parent 051907b commit fb992f9
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 fb992f9

Please sign in to comment.