Skip to content

examples: wait_for the first request on the remaining ungated proxies - #1667

Merged
phlax merged 1 commit into
envoyproxy:mainfrom
phlax:examples-wait-sweep
Nov 23, 2026
Merged

phlax merged 1 commit into
envoyproxy:mainfrom
phlax:examples-wait-sweep

Conversation

@phlax

@phlax phlax commented Nov 23, 2026

Copy link
Copy Markdown
Member

Follow-up to the earlier wait_for hardening, which covered the flake-tracker examples and the multi-proxy ones but missed single-proxy examples — gzip is the clearest case (its sibling zstd was already guarded, gzip wasn't, and it flaked envoy's verify_examples).

Swept every example whose proxy Envoy has no healthcheck and whose first request wasn't already retried:

example first request guarded
gzip, datadog-tracing, lua, lua-cluster-specifier, rbac first HTTP request -> wait_for
dynamic-config-cp first admin config_dump
local_ratelimit probe the stats listener first (so no rate-limit tokens are spent)
golang-network, udp retry the first nc send until the backend logs it

Already guarded (left as-is): mysql / postgres / redis / grpc-bridge / locality-load-balancing (first proxy interaction is already a wait_for), plus everything from the prior passes.

Deliberately not in this PR: kafka / kafka-mesh (first hit is a Kafka-broker client call through the proxy - needs protocol-specific, idempotent retry) and fault-injection (its 20s request loop is already race-tolerant). Those want individual treatment + testing rather than a blind wait_for.

This is the stopgap; the proper fix (proxy healthchecks) is a separate effort. gzip verified green locally.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 11:26
@phlax
phlax force-pushed the examples-wait-sweep branch from 2eeec49 to 1db8868 Compare November 23, 2026 11:28

Copilot AI 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.

🟡 Changes recommended

The readiness check can pass before the traffic listener is ready, leaving subsequent requests without retries vulnerable to a startup race.

1 open issue
What changed in this PR

This PR extends startup retry protection to nine example verification scripts whose Envoy proxies lack healthchecks, reducing first-request failures in CI.

Changes:

  • Wraps initial HTTP and admin requests in wait_for.
  • Adds an admin probe before rate-limit checks to avoid spending tokens.
  • Retries initial TCP and UDP sends until backend logs confirm receipt.
File Description
udp/​verify.sh Retries the first UDP packet until logged by the backend.
rbac/​verify.sh Retries the initial access-denied assertion.
lua/​verify.sh Retries the first Lua response assertion.
lua-cluster-specifier/​verify.sh Retries the normal-cluster response check.
local_ratelimit/​verify.sh Adds an admin probe before rate-limit checks.
gzip/​verify.sh Retries the initial gzip compression check.
golang-network/​verify.sh Retries TCP sends until the transformed message is logged.
dynamic-config-cp/​verify.sh Retries the initial static-cluster config dump check.
datadog-tracing/​verify.sh Retries the trace-header response check.

Review effort: Balanced

Comment thread local_ratelimit/verify.sh Resolved

Copilot AI 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.

🔵 Needs a closer look

The stats endpoint can respond before proxy workers are ready, so the guard leaves the first unretried rate-limit request vulnerable to the startup race.

1 open issue

Review effort: Balanced

Follow-up to the earlier wait_for hardening, which only covered the tracker
flakes and the multi-proxy examples and so missed single-proxy ones like gzip
(whose sibling zstd was already guarded). Sweep the rest: every example whose
proxy Envoy has no healthcheck and whose first request wasn't already retried.

- gzip, datadog-tracing, lua, lua-cluster-specifier, rbac: first HTTP request
- dynamic-config-cp: first admin config_dump
- local_ratelimit: probe the stats listener first (no rate-limit tokens spent)
- golang-network, udp: retry the first nc send until the backend logs it

mysql/postgres/redis/grpc-bridge/locality already guard their first proxy hit;
kafka/kafka-mesh (broker-protocol client) and fault-injection (self-tolerant
20s loop) need protocol-specific handling and are left for a follow-up.
gzip verified green locally.

Signed-off-by: Ryan Northey <ryan@synca.io>

Copilot AI 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.

🟢 Approval recommended

No active review issues were identified in the startup-retry changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@phlax
phlax merged commit 5d3f174 into envoyproxy:main Nov 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants