Skip to content

fix: fail over from a hung bootstrap broker during InitProducerId#318

Merged
ShogunPanda merged 2 commits into
platformatic:mainfrom
aahoughton:fix/issue-317-init-producer-id-failover
Jun 16, 2026
Merged

fix: fail over from a hung bootstrap broker during InitProducerId#318
ShogunPanda merged 2 commits into
platformatic:mainfrom
aahoughton:fix/issue-317-init-producer-id-failover

Conversation

@aahoughton

Copy link
Copy Markdown
Contributor

#initIdempotentProducer and #findCoordinator never passed attempt to kGetBootstrapConnection, so its retry-rotation branch stayed dead and an idempotent producer kept retrying InitProducerId against a reachable-but-hung bootstrap broker instead of failing over to known-healthy brokers.

Thread attempt through both paths. Fixes #317.

#initIdempotentProducer and #findCoordinator never passed `attempt` to
kGetBootstrapConnection, so its retry-rotation branch stayed dead and an
idempotent producer kept retrying InitProducerId against a reachable-but-hung
bootstrap broker instead of failing over to known-healthy brokers.

Thread `attempt` through both paths. Fixes platformatic#317.

Signed-off-by: Andrew Houghton <aah@roarmouse.org>

@ShogunPanda ShogunPanda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A little nit but the rest LGTM!

Comment thread test/clients/producer/producer.test.ts Outdated
aahoughton added a commit to aahoughton/kafka that referenced this pull request Jun 15, 2026
Replace hand-rolled getFirstAvailable override with the existing mock
helper. Addresses review feedback on platformatic#318.
Replace hand-rolled getFirstAvailable override with the existing mock
helper. Addresses review feedback on platformatic#318.

Signed-off-by: Andrew Houghton <aah@roarmouse.org>
@aahoughton aahoughton force-pushed the fix/issue-317-init-producer-id-failover branch from 87dfc55 to 5ee3904 Compare June 16, 2026 00:26

@ShogunPanda ShogunPanda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@ShogunPanda ShogunPanda merged commit af3f7d1 into platformatic:main Jun 16, 2026
29 of 49 checks passed
@aahoughton aahoughton deleted the fix/issue-317-init-producer-id-failover branch June 17, 2026 02:06
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.

Idempotent InitProducerId doesn't fail over from an unresponsive bootstrap broker

2 participants