• Shingo Omura's avatar
    change sort function of scheduling queue to avoid starvation when unschedulable… · 22079a79
    Shingo Omura authored
    change sort function of scheduling queue to avoid starvation when unschedulable pods are in the queue
    
    When starvation heppens:
    - a lot of unschedulable pods exists in the head of queue
    - because condition.LastTransitionTime is updated only when condition.Status changed
    - (this means that once a pod is marked unschedulable, the field never updated until the pod successfuly scheduled.)
    
    What was changed:
    - condition.LastProbeTime is updated everytime when pod is determined
    unschedulable.
    - changed sort function so to use LastProbeTime to avoid starvation
    described above
    
    Consideration:
    - This changes increases k8s API server load because it updates Pod.status whenever scheduler decides it as
    unschedulable.
    Signed-off-by: 's avatarShingo Omura <everpeace@gmail.com>
    22079a79
scheduling_queue_test.go 23.1 KB