Skip to content

examples: wait_for to absorb proxy startup races - #1651

Merged
phlax merged 1 commit into
envoyproxy:mainfrom
phlax:zipkin-tls-wait
Nov 20, 2026
Merged

phlax merged 1 commit into
envoyproxy:mainfrom
phlax:zipkin-tls-wait

Conversation

@phlax

@phlax phlax commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

The proxy Envoys in these examples have no healthcheck, so docker compose up --wait can return before Envoy is serving and the first request in verify.sh races startup. Several are on the flake tracker (#1629); the rest have the same latent race.

Fix: wait on the first request to each ungated proxy, and nowhere already gated (a proxy with a healthcheck, or an upstream already warmed by a prior waited request).

  • front-proxy, load-reporting-service — single proxy; one wait.
  • double-proxy — one request chains through three proxies; one wait covers the chain.
  • zipkin, opentelemetry, skywalking — front proxy + envoy-1 (/trace/1) + envoy-2 (/trace/2), each service_started; wait on each trace path.
  • tls, websocket — four independent proxy containers, one per port; wait on each.
  • tls-sni — proxy and proxy-client are separate Envoys; wait on the first query to each.

No compose/admin changes. All verified green locally.

A workaround, not the root fix — giving the proxy Envoys healthchecks is a separate change.

(bot assisted)

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 remain for the startup-retry changes in the Zipkin and TLS example checks.

No open issues 🎉

What changed in this PR

This PR reduces startup-related flakes in the Zipkin and TLS example checks tracked by #1629. It retries the first request while Envoy starts serving, without adding proxy healthchecks.

Changes:

  • Wrap each example’s first response assertion in wait_for 10.
  • Add comments explaining the startup-race workaround; leave subsequent checks unchanged.
File Description
zipkin/​verify.sh Retry the initial request to service-1 through the proxy.
tls/​verify.sh Retry the initial HTTPS-to-HTTP response assertion.

Review effort: Balanced

@phlax
phlax force-pushed the zipkin-tls-wait branch 2 times, most recently from e0a3cec to b61ad0b Compare November 20, 2026 17:20
@phlax phlax changed the title zipkin, tls: retry the first request to absorb the startup race front-proxy, zipkin, tls, lrs: wait_for to absorb the proxy startup race Nov 20, 2026
@phlax
phlax requested a balanced review from Copilot November 20, 2026 17:21

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

Readiness checks still leave independent TLS proxies and Zipkin’s service-2 path unverified, allowing slower Envoy startup to cause connection errors or 503s in subsequent assertions.

2 open issues

Review effort: Balanced

Comment thread tls/verify.sh Resolved
Comment thread zipkin/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.

🟡 Changes recommended

The readiness check treats a failed curl as success because the child shell lacks -e, bypassing retries and leaving the hostname check exposed to a startup race.

1 open issue
2 resolved since last review

Review effort: Balanced

Comment thread tls/verify.sh Resolved
@phlax phlax changed the title front-proxy, zipkin, tls, lrs: wait_for to absorb the proxy startup race examples: wait_for to absorb proxy startup races Nov 20, 2026
@phlax
phlax requested a balanced review from Copilot November 20, 2026 18:15

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 retry wait incorrectly treats curl connection failures as success because bash -c lacks errexit, leaving the subsequent hostname check racing proxy startup.

2 open issues

Review effort: Balanced

Comment thread tls/verify.sh Resolved
The proxy Envoys in these examples have no healthcheck, so `docker compose
up --wait` can return before they are serving and the first request races
startup. Wait on the first hit to each ungated proxy (and no further):

- front-proxy, load-reporting-service, double-proxy: single proxy / chain
- zipkin, opentelemetry, skywalking: front proxy + envoy-1/envoy-2
- tls, websocket: four independent proxies, one per port
- tls-sni: proxy + proxy-client

All verified 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

The review reports no active issues with the startup-readiness retry changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@phlax
phlax merged commit fddb5af into envoyproxy:main Nov 20, 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