Skip to content

fix: wait for all runners before reporting ready - #10747

Open
zhaohuabing wants to merge 7 commits into
envoyproxy:mainfrom
zhaohuabing:fix-readyz-runners
Open

zhaohuabing wants to merge 7 commits into
envoyproxy:mainfrom
zhaohuabing:fix-readyz-runners

Conversation

@zhaohuabing

@zhaohuabing zhaohuabing commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

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:

  • The Service could route Envoy's xDS connections to that pod instead of a replica that was actually serving, and they got connection refused.
  • During a rollout, the old pod could be terminated as soon as the new one turned ready, even though the new one couldn't serve xDS yet.

/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.

@netlify

netlify Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 77200fc
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6b1268e275fb949f4aa8bee9
😎 Deploy Preview https://deploy-preview-10747--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@zhaohuabing zhaohuabing added this to the v1.11.0-rc.1 Release milestone Dec 1, 2026
@zhaohuabing
zhaohuabing marked this pull request as ready for review December 1, 2026 09:06
@zhaohuabing
zhaohuabing requested a review from a team as a code owner December 1, 2026 09:06
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-04T07:17:09.784743Z
We couldn’t complete this review. Comment @codex review to try again.
77200fc New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.88%. Comparing base (0b677fb) to head (77200fc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/provider/kubernetes/kubernetes.go 0.00% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/cmd/server.go
}
started = append(started, r.runner)
}
close(cfg.RunnersReady)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Moved the bind into xdsrunner.Start, so a bind failure now fails startup and RunnersReady only closes after the port is open.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/cmd/server.go
}
started = append(started, r.runner)
}
close(cfg.RunnersReady)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. The rate limit runner now binds its config server port in Start too, so a bind failure fails startup before RunnersReady closes.

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>
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/cmd/server.go
}
started = append(started, r.runner)
}
close(cfg.RunnersReady)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave it for now.

zhaohuabing and others added 2 commits December 4, 2026 04:49
Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants