Repository navigation
fix: wait for all runners before reporting ready - #10747
zhaohuabing wants to merge 7 commits into
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10747 +/- ##
==========================================
+ Coverage 82.85% 82.88% +0.02%
==========================================
Files 278 278
Lines 44695 44702 +7
==========================================
+ Hits 37032 37050 +18
+ Misses 7662 7650 -12
- Partials 1 2 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f26fc53363
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| started = append(started, r.runner) | ||
| } | ||
| close(cfg.RunnersReady) |
There was a problem hiding this comment.
Wait for the xDS listener before marking runners ready
On startup, xdsrunner.Start launches serveXdsServer in a goroutine and returns before that goroutine calls net.Listen. If the bind is delayed or fails because the port is occupied, closing RunnersReady here lets /readyz pass while xDS is unavailable, and it stays green after a bind failure. Have the xDS runner signal readiness only after binding succeeds, and propagate bind failures before closing this barrier.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch. Moved the bind into xdsrunner.Start, so a bind failure now fails startup and RunnersReady only closes after the port is open.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de126b1aef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| started = append(started, r.runner) | ||
| } | ||
| close(cfg.RunnersReady) |
There was a problem hiding this comment.
Wait for the rate-limit xDS listener before marking ready
When EnvoyGateway.RateLimit is configured, this loop closes the barrier after the rate-limit runner's Start returns, but globalratelimit.Runner.Start only launches serveXdsConfigServer; that goroutine calls net.Listen later and logs bind failures instead of propagating them. If the rate-limit xDS port is occupied, the applicable provider /readyz check goes green while the rate-limit config service is absent. The regular xDS listener from the earlier comment is now bound synchronously; this separate rate-limit listener is fresh evidence of the remaining readiness gap.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed. The rate limit runner now binds its config server port in Start too, so a bind failure fails startup before RunnersReady closes.
394a402 to
3499830
Compare
The readiness probe only checked that the provider cache had synced, so a pod could take traffic before the xDS server and the other runners were up. Now /readyz also waits until every runner has started. Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com> Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com> Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
The xDS runner now binds its port before Start returns, so readiness only passes once the port is open and a bind failure stops startup instead of being logged. The cmd tests use a different xDS port so they don't clash with the xds runner tests when packages run in parallel. Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com> Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
Same change as the xDS runner: the rate limit runner now binds its config server port before Start returns, so a bind failure stops startup instead of being logged while readiness passes. Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com> Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
3499830 to
7cd32d3
Compare
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c418cddcbc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| started = append(started, r.runner) | ||
| } | ||
| close(cfg.RunnersReady) |
There was a problem hiding this comment.
Wait for the Wasm cache listener before marking runners ready
When a Gateway policy uses HTTP/OCI Wasm and port 18002 is occupied, this gate can close after gatewayapi.Runner.Start returns, even though it only launches startWasmCache asynchronously (internal/gatewayapi/runner/runner.go:178-190). The Wasm server logs ListenAndServe* failures instead of propagating them (internal/wasm/httpserver.go:127-136), while generated module URLs point to that listener (internal/wasm/httpserver.go:222-223), so the pod can become ready while Envoy's Wasm downloads fail. Wait for the listener to bind before closing this barrier, or propagate its startup error.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Let's leave it for now.
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
The readiness probe only checked that the provider cache had synced, which happens before the gateway-api, xDS, infra and other runners start. That let a pod be marked ready before its xDS server was up, which causes two problems:
/readyz now also waits until every runner has started, for both the Kubernetes and file providers. Runners that wait on leader election do it in the background, so standby replicas still become ready. The xDS and rate limit runners also bind their ports before Start returns, so a bind failure stops startup instead of only being logged.
This came up in #10337, where startup can now block for a while before the xDS runner starts.