fix: stabilize InferencePool parent status reconciliation#2333
Open
Aias00 wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR stabilizes InferencePool status reconciliation in the controller by avoiding no-op status updates (which can trigger repeated reconciles) and by requeueing once after a real status change so cache-backed Gateway/HTTPRoute views can converge before conformance checks evaluate parent status.
Changes:
- Requeue reconciliation once (
RequeueAfter: 1s) after a successfulInferencePoolstatus update to allow informer caches to converge. - Skip status updates when the computed parent statuses are semantically unchanged (ignoring
LastTransitionTime) to avoid endless reconcile loops. - Add a regression test covering the conformance scenario with multiple HTTPRoutes pointing to multiple Gateway parents for a single InferencePool.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
internal/controller/inference_pool.go |
Adds status-change detection (ignoring LastTransitionTime) and a one-time requeue after status updates to stabilize parent-status reconciliation. |
internal/controller/inference_pool_test.go |
Updates existing expectations for the new requeue behavior and adds a regression test for multiple HTTPRoute/Gateway parents. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2333 +/- ##
==========================================
+ Coverage 84.83% 84.89% +0.06%
==========================================
Files 148 148
Lines 21877 21939 +62
==========================================
+ Hits 18559 18626 +67
+ Misses 2197 2194 -3
+ Partials 1121 1119 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes envoyproxy#1331. Inference Extension conformance can create multiple HTTPRoutes for the same InferencePool in quick succession. A reconcile can observe only one referenced Gateway through the controller cache and write a partial Parents status, then receive no later event to recompute the complete parent set. Return a short requeue only when the InferencePool status actually changes. Status equality ignores LastTransitionTime so the follow-up reconcile converges and stops instead of looping forever. Constraint: controller-runtime cache-backed route and gateway lists can lag related object events. Rejected: Increasing conformance timeouts, because stale status can persist indefinitely without another reconcile. Confidence: high Scope-risk: moderate; changes InferencePool reconcile scheduling after status updates. Tested: go test ./internal/controller -run TestInferencePoolController Tested: go test ./internal/controller Tested: make lint Signed-off-by: liuhy <liuhongyu@apache.org>
Aias00
force-pushed
the
fix/inferencepool-status-flake
branch
from
July 7, 2026 08:53
208ab0b to
1a24ec8
Compare
The status-requeue fix could still miss convergence: when the first reconcile observes zero referenced Gateways because the controller-runtime cache-backed list lags, and the InferencePool status is already empty, inferencePoolParentStatusesEqual(empty, empty) is true. Relying on status mutation alone then skips the requeue, and the status can stay stale indefinitely if no later event fires another reconcile. Close the gap by arming a short follow-up reconcile on the first observed sync at a generation (in addition to on every status change), and stopping once the status is observed unchanged at that generation. The follow-up re-reads a now-converged cache. A spec change (new generation) re-arms the follow-up; a deleted InferencePool forgets its marker so the map stays bounded. Constraint: controller-runtime cache-backed route and gateway lists can lag related object events, so an unchanged (empty) status cannot be trusted on first observation. Rejected: Requeueing indefinitely on every successful sync, because that loops forever; the generation-keyed arm/consume marker converges and stops. Tested: go test ./internal/controller -run TestInferencePoolController Tested: go test ./internal/controller Tested: make lint Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: liuhy <liuhongyu@apache.org>
…-generation pendingRequeues used "namespace/name@generation" as the key. When an InferencePool advanced from generation N to N+1 before the N follow-up was consumed, the N+1 sync added a new marker but the stale N marker lingered — it could only be cleared by forgetInferencePoolRequeue at object deletion. A long-lived, frequently-updated InferencePool accumulated one stale entry per generation for the controller's lifetime. Track the generation as the map value instead, keyed by "namespace/name". A spec change overwrites the single per-object entry, re-arming the follow-up without leaving stale entries behind. forgetInferencePoolRequeue simplifies to a single delete. Adds a regression test that advances generations while a follow-up is armed and asserts the map holds one entry; it fails on the old implementation (3 entries). Also covers the delete path directly. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: liuhy <liuhongyu@apache.org>
Aias00
force-pushed
the
fix/inferencepool-status-flake
branch
from
July 12, 2026 06:17
d663dfd to
2892ac3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This stabilizes InferencePool parent status reconciliation for the Gateway API Inference Extension conformance case where multiple HTTPRoutes reference the same InferencePool through different Gateway parents. When status changes, the controller now schedules one short follow-up reconcile so cache-backed route and gateway lists can converge. The follow-up reconcile stops once the desired parent status is already present.
This also adds a regression test for two HTTPRoutes pointing at two Gateway parents for one InferencePool.
Related Issues/PRs (if applicable)
Fixes #1331.
Special notes for reviewers (if applicable)
Validated locally with
go test ./internal/controller -run TestInferencePoolController,go test ./internal/controller, andmake lint.