mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Fix scheduler misc
This commit is contained in:
parent
e7192a4955
commit
ee24513e47
2
pkg/scheduler/internal/cache/cache.go
vendored
2
pkg/scheduler/internal/cache/cache.go
vendored
@ -35,7 +35,7 @@ var (
|
|||||||
|
|
||||||
// New returns a Cache implementation.
|
// New returns a Cache implementation.
|
||||||
// It automatically starts a go routine that manages expiration of assumed pods.
|
// It automatically starts a go routine that manages expiration of assumed pods.
|
||||||
// "ttl" is how long the assumed pod will get expired.
|
// "ttl" is how long the assumed pod will get expired, "0" means pod will never expire.
|
||||||
// "stop" is the channel that would close the background goroutine.
|
// "stop" is the channel that would close the background goroutine.
|
||||||
func New(ttl time.Duration, stop <-chan struct{}) Cache {
|
func New(ttl time.Duration, stop <-chan struct{}) Cache {
|
||||||
cache := newCache(ttl, cleanAssumedPeriod, stop)
|
cache := newCache(ttl, cleanAssumedPeriod, stop)
|
||||||
|
@ -447,8 +447,7 @@ func (p *PriorityQueue) flushBackoffQCompleted() {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
pod := rawPodInfo.(*framework.QueuedPodInfo).Pod
|
pod := rawPodInfo.(*framework.QueuedPodInfo).Pod
|
||||||
boTime := p.getBackoffTime(rawPodInfo.(*framework.QueuedPodInfo))
|
if p.isPodBackingoff(rawPodInfo.(*framework.QueuedPodInfo)) {
|
||||||
if boTime.After(p.clock.Now()) {
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
_, err := p.podBackoffQ.Pop()
|
_, err := p.podBackoffQ.Pop()
|
||||||
|
@ -98,6 +98,7 @@ func (v *cfgValidator) validate(cfg config.KubeSchedulerProfile, f framework.Fra
|
|||||||
for _, plCfg := range cfg.PluginConfig {
|
for _, plCfg := range cfg.PluginConfig {
|
||||||
if plCfg.Name == queueSort {
|
if plCfg.Name == queueSort {
|
||||||
queueSortArgs = plCfg.Args
|
queueSortArgs = plCfg.Args
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(v.queueSort) == 0 {
|
if len(v.queueSort) == 0 {
|
||||||
|
@ -195,7 +195,7 @@ func (sched *Scheduler) schedulingCycle(ctx context.Context, state *framework.Cy
|
|||||||
metrics.PodScheduleError(fwk.ProfileName(), metrics.SinceInSeconds(start))
|
metrics.PodScheduleError(fwk.ProfileName(), metrics.SinceInSeconds(start))
|
||||||
reason = v1.PodReasonSchedulerError
|
reason = v1.PodReasonSchedulerError
|
||||||
}
|
}
|
||||||
// One of the plugins returned status different than success or wait.
|
// One of the plugins returned status different from success or wait.
|
||||||
fwk.RunReservePluginsUnreserve(ctx, state, assumedPod, scheduleResult.SuggestedHost)
|
fwk.RunReservePluginsUnreserve(ctx, state, assumedPod, scheduleResult.SuggestedHost)
|
||||||
if forgetErr := sched.Cache.ForgetPod(assumedPod); forgetErr != nil {
|
if forgetErr := sched.Cache.ForgetPod(assumedPod); forgetErr != nil {
|
||||||
klog.ErrorS(forgetErr, "Scheduler cache ForgetPod failed")
|
klog.ErrorS(forgetErr, "Scheduler cache ForgetPod failed")
|
||||||
|
Loading…
Reference in New Issue
Block a user