Skip to content

examples: wait_for the first broker call on kafka/kafka-mesh - #1671

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

phlax merged 1 commit into
envoyproxy:mainfrom
phlax:kafka-wait

Conversation

@phlax

@phlax phlax commented Nov 23, 2026

Copy link
Copy Markdown
Member

The kafka and kafka-mesh proxy Envoys have no healthcheck, so docker compose up --wait can return before the listener is serving and the first kafka client call races it — which is what fails the examples job on the cp-kafka digest-bump PRs #1657 / #1665 (the bumps are fine; the example flakes).

Fix: retry the first end-to-end broker call until envoy and the upstream broker/cluster are both serving.

  • kafka — the create-topic (--if-not-exists keeps the retry idempotent)
  • kafka-mesh — the first produce to apples

kafka_client is a shell function, so it's passed straight to wait_for (no bash -c, same shell). Both verified green locally.

Follow-up to the wait_for sweep (#1667) — these two were deferred there as protocol-specific. With this in, #1657/#1665 should pass on /retest.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 13:08

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 asynchronous Kafka producer can hide delivery failures and prevent retries, leaving the consumer waiting indefinitely; adding --sync is needed to propagate failed sends.

1 open issue
What changed in this PR

This PR adds startup retries to Kafka sandbox verification, extending #1667 to address the flakes exposed by dependency bumps #1657 and #1665.

Changes:

  • Retries Kafka topic creation with --if-not-exists to make repeated attempts safe.
  • Wraps the first Kafka mesh produce call in wait_for.
File Description
kafka/​verify.sh Adds an idempotent retry around initial topic creation.
kafka-mesh/​verify.sh Adds a retry around the first produce to apples.

Review effort: Balanced

Comment thread kafka-mesh/verify.sh Resolved
The kafka and kafka-mesh proxy Envoys have no healthcheck, so `compose up
--wait` can return before the listener is serving and the first kafka client
call races it (what fails the examples job on cp-kafka bump PRs envoyproxy#1657/envoyproxy#1665).
Retry the first end-to-end broker call until envoy and the upstream broker are
serving: kafka's create-topic (--if-not-exists for idempotent retry) and
kafka-mesh's first produce. Both 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

The Kafka startup-readiness changes have no active review issues.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@phlax
phlax merged commit d51add0 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