mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-05-22 09:03:06 +00:00
When KubeVirt sets EvictionInProgressAnnotationKey before returning TooManyRequests, the informer's UpdateFunc can call addPod (evictionAssumed=false) before evictPod's assumePod call arrives. assumePod found the entry already present and returned early, leaving evictionAssumed=false. DeleteFunc then skipped the "success" metric. Fix: if the existing entry has evictionAssumed=false (added by addPod), upgrade it in place without double-counting the pod in the counters. Adds TestEvictionInBackgroundMetrics_InformerRace to reproduce the race deterministically. Signed-off-by: Simone Tiraboschi <stirabos@redhat.com>