KAFKA-20981: fail on an unknown status code in the Streams heartbeat response - #23262
Open
mjsax wants to merge 1 commit into
Open
KAFKA-20981: fail on an unknown status code in the Streams heartbeat response#23262mjsax wants to merge 1 commit into
mjsax wants to merge 1 commit into
Conversation
…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.
Member
Author
|
We should cherry-pick this back all the way to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.