From 41cde37f0071bef3dd8f03ea8a293dc6fd915ec6 Mon Sep 17 00:00:00 2001 From: Manthan Parmar Date: Tue, 18 Nov 2025 11:47:00 -0500 Subject: [PATCH] Update pkg/scheduler/backend/queue/scheduling_queue.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Maciej Skoczeń <87243939+macsko@users.noreply.github.com> --- pkg/scheduler/backend/queue/scheduling_queue.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/scheduler/backend/queue/scheduling_queue.go b/pkg/scheduler/backend/queue/scheduling_queue.go index 2e9e5c09b35..66bdbb3f594 100644 --- a/pkg/scheduler/backend/queue/scheduling_queue.go +++ b/pkg/scheduler/backend/queue/scheduling_queue.go @@ -610,8 +610,11 @@ func (p *PriorityQueue) runPreEnqueuePlugin(ctx context.Context, logger klog.Log // No need to change GatingPlugin; it's overwritten by the next PreEnqueue plugin if they gate this pod, or it's overwritten with an empty string if all PreEnqueue plugins pass. return s } + // Only increment metric and insert if not already incremented for this plugin + if !pInfo.UnschedulablePlugins.Has(pl.Name()) && !pInfo.PendingPlugins.Has(pl.Name()) { + metrics.UnschedulableReason(pl.Name(), pod.Spec.SchedulerName).Inc() + } pInfo.UnschedulablePlugins.Insert(pl.Name()) - metrics.UnschedulableReason(pl.Name(), pod.Spec.SchedulerName).Inc() pInfo.GatingPlugin = pl.Name() pInfo.GatingPluginEvents = p.pluginToEventsMap[pInfo.GatingPlugin] if s.Code() == fwk.Error {