Skip to content

KAFKA-20981: fail on an unknown status code in the Streams heartbeat response - #23262

Open
mjsax wants to merge 1 commit into
apache:trunkfrom
mjsax:kafka-20981-handle-unknown-heartbeat-status
Open

KAFKA-20981: fail on an unknown status code in the Streams heartbeat response#23262
mjsax wants to merge 1 commit into
apache:trunkfrom
mjsax:kafka-20981-handle-unknown-heartbeat-status

Conversation

@mjsax

@mjsax mjsax commented Aug 25, 2026

Copy link
Copy Markdown
Member

A new StreamsGroupHeartbeatResponse status code is a semantic contract
change: it requires a KIP and a request-version bump, and the broker
must gate the new code so it is only sent to clients that advertise the
introducing version (as it does today for MISSING_CLIENT_TAGS, withheld
from v0 clients). If a broker bug sends a code an older client does not
recognize, the client decodes every status via Status.fromCode, which
throws -- and that throw, raised while handling the heartbeat response,
is currently swallowed (KAFKA-20860): the client keeps heartbeating,
advances its member epoch, and silently ignores the assignment and every
one after it, while the coordinator sees a healthy member.

This PR rejects the response as a whole, before any of it is applied, if
it carries a status this client cannot interpret: log it, surface a
KafkaException through the uncaught-exception handler, and fail the
member, so the error is visible instead of silently dropping every
assignment.

…response

A new StreamsGroupHeartbeatResponse status code is a semantic contract change: it
requires a KIP and a request-version bump, and the broker must gate the new code
so it is only sent to clients that advertise the introducing version (as it does
today for MISSING_CLIENT_TAGS, withheld from v0 clients). If a broker bug sends a
code an older client does not recognize, the client decodes every status via
Status.fromCode, which throws -- and that throw, raised while handling the
heartbeat response, is currently swallowed (KAFKA-20860): the client keeps
heartbeating, advances its member epoch, and silently ignores the assignment and
every one after it, while the coordinator sees a healthy member.

This PR rejects the response as a whole, before any of it is applied, if it carries a
status this client cannot interpret: log it, surface a KafkaException through the
uncaught-exception handler, and fail the member, so the error is visible instead
of silently dropping every assignment.
@mjsax mjsax added streams KIP-1071 PRs related to KIP-1071 labels Aug 25, 2026
@mjsax

mjsax commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

We should cherry-pick this back all the way to 4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients consumer KIP-1071 PRs related to KIP-1071 small Small PRs streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant