-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KAFKA-18339: Remove raw unversioned direct SASL protocol (KIP-896) #18295
base: trunk
Are you sure you want to change the base?
Conversation
// Raise an error prior to parsing if the api cannot be handled at this layer. This avoids | ||
// unnecessary exposure to some of the more complex schema types. | ||
if (apiKey != ApiKeys.API_VERSIONS && apiKey != ApiKeys.SASL_HANDSHAKE) | ||
throw new IllegalSaslStateException("Unexpected Kafka request of type " + apiKey + " during SASL handshake."); | ||
throw new InvalidRequestException("Unexpected Kafka request of type " + apiKey + " during SASL handshake."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rajinisivaram Do you know why we send IllegalSaslStateException
here and InvalidRequestException
for every other error? We seem to have special handling for Sasl related exceptions, but it doesn't seem to make sense in this case since we can't properly propagate an error if we get the wrong request type.
// InvalidRequestException is thrown if the request is not in Kafka format or if the API key is invalid. | ||
// If it's the initial request, this could be an ancient client (see method documentation for more details), | ||
// a client configured with the wrong security protocol or a non kafka-client altogether (eg http client). | ||
throw new InvalidRequestException("Invalid request, potential reasons: kafka client configured with the " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the error message and check if it makes sense. This will only be captured in the broker, but still good to try and make it as informative as possible.
061cbb0
to
12d120c
Compare
@rajinisivaram @omkreddy Any of you has cycles to review this small change? |
Clients that support SASL but don't implement KIP-43 (eg Kafka producer/consumer 0.9.0.x) will
fail to connect after this change.
Added unit tests and also manually tested with the console producer 0.9.0.
While testing, I noticed that the logged message when a 0.9.0 Java client is used without sasl is
slightly misleading - fixed that too.
Committer Checklist (excluded from commit message)