kubernetes-sigs / descheduler

Descheduler for Kubernetes
https://sigs.k8s.io/descheduler
Apache License 2.0
4.23k stars 645 forks source link

Is descheduler executed in a loop? #1377

Closed ipsum-0320 closed 2 months ago

ipsum-0320 commented 2 months ago

In the line of this file, After wait.NonSlidingUntil() is submitted, the function ends, and defer cancel() will be executed, thus interrupting the cycle execution of wait.NonSlidingUntil().

This may mean that descheduler.runDeschedulerLoop() can only be executed once, regardless of whether rs.DeschedulingInterval is set or not.

I think this is a BUG.

damemi commented 2 months ago

Hi @ipsum-0320, have you run into any issues trying to run the descheduler in a loop? wait.NonSlidingUntil() should execute synchronously until the context channel is closed. So, that should block the deferred cancel() from RunDeschedulerStrategies() until the channel is closed from somewhere else.

ipsum-0320 commented 2 months ago

Hi @ipsum-0320, have you run into any issues trying to run the descheduler in a loop? wait.NonSlidingUntil() should execute synchronously until the context channel is closed. So, that should block the deferred cancel() from RunDeschedulerStrategies() until the channel is closed from somewhere else.

@damemi okok, i know what you mean, thank you very much! 😊