Skip to content

Commit

Permalink
schedule: fix panic when switching placement rules (#7415) (#7425)
Browse files Browse the repository at this point in the history
close #7414

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 7, 2024
1 parent 83f290a commit decd310
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/schedule/checker/rule_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ func (c *RuleChecker) CheckWithFit(region *core.RegionInfo, fit *placement.Regio
return
}

// the placement rule is disabled
if fit == nil {
return
}

// If the fit is calculated by FitRegion, which means we get a new fit result, thus we should
// invalid the cache if it exists
c.ruleManager.InvalidCache(region.GetID())
Expand Down

0 comments on commit decd310

Please sign in to comment.