Skip to content

repro: fix kafka container port handling (advertised listener + controller port) - #118

Merged
Anubhuti Sinha (anubhutisinha04) merged 2 commits into
NSLS2:demo/ios-nsls2from
sligara7:fix/repro-kafka-advertised-port
Aug 7, 2026
Merged

repro: fix kafka container port handling (advertised listener + controller port)#118
Anubhuti Sinha (anubhutisinha04) merged 2 commits into
NSLS2:demo/ios-nsls2from
sligara7:fix/repro-kafka-advertised-port

Conversation

@sligara7

@sligara7 Anthony Sligar (sligara7) commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Two one-line fixes to the kafka container in reproduce.sh, found while running the stack on a host where the default ports were already taken. Defaults are unchanged — with no env overrides the behavior is identical to before.

  1. Advertised listener: was hardcoded to localhost:9092, so the documented KAFKA_PORT override let clients bootstrap on the custom port but then redirected produce connections to 9092 — silently cross-connecting to whatever broker holds that port. Now advertises localhost:${KAFKA_PORT}.
  2. KRaft controller port: -p 9093:9093 published the controller port to the host, but nothing outside the container uses it (the quorum voter address is container-local). The needless binding made up fail on any host where 9093 was taken. Removed.

Field-tested: the 2026-08-07 validation run (up + smoke + a completed XAS_scan with the fluorescence detector) ran with these fixes and KAFKA_PORT=9094 on a host where 9092 hosted another broker.

The advertised listener was hardcoded to localhost:9092, so a KAFKA_PORT
override let clients bootstrap on the custom port but then redirected
them to 9092 for produce connections. Found running the stack on a host
where 9092 was already taken.
Nothing outside the container uses 9093 (the quorum voter address is
container-local), but the hardcoded host binding made 'up' fail on any
host where 9093 was already taken.
@sligara7 Anthony Sligar (sligara7) changed the title repro: parametrize kafka advertised listener with KAFKA_PORT repro: fix kafka container port handling (advertised listener + controller port) Aug 7, 2026
@anubhutisinha04
Anubhuti Sinha (anubhutisinha04) merged commit fb9c81e into NSLS2:demo/ios-nsls2 Aug 7, 2026
9 checks passed
@sligara7
Anthony Sligar (sligara7) deleted the fix/repro-kafka-advertised-port branch August 7, 2026 20:56
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