-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
HADOOP-19308: FastSaslClientFactory failing to initialise due to NPE #7112
base: branch-3.4.0
Are you sure you want to change the base?
Conversation
@apurtell Please review the PR. |
💔 -1 overall
This message was automatically generated. |
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.
The NPE is from
org.apache.qpid.client.security.amqplain.AmqPlainSaslClientFactory.getMechanismNames(AmqPlainSaslClientFactory.java:50)
If you read the javadoc of the SaslClientFactory#getMechanismNames
/**
* Returns an array of names of mechanisms that match the specified
* mechanism selection policies.
* @param props The possibly null set of properties used to specify the
* security policy of the SASL mechanisms. For example, if {@code props}
* contains the {@code Sasl.POLICY_NOPLAINTEXT} property with the value
* {@code "true"}, then the factory must not return any SASL mechanisms
* that are susceptible to simple plain passive attacks.
* See the {@code Sasl} class for a complete list of policy properties.
* Non-policy related properties, if present in {@code props}, are ignored,
* including any map entries with non-String keys.
* @return A non-null array containing a IANA-registered SASL mechanism names.
*/
public abstract String[] getMechanismNames(Map<String,?> props);
For props it does say props The possibly null set of properties
, So props
can be null
, AmqPlainSaslClientFactory
should handle the null
cases, not us
I agree that fix should be in AmqPlainSaslClientFactory but can we just set the props to empty map if it is set to null? @Abhey I am somewhat hesitant to catch the exception and continue even if loading of some SaslClientFactory fails. |
Fundamentally to me that seems wrong only, any implementation is free to have different logic for Moreover for the ones doing the
you have to patch hadoop, release it & change that version in the client, that goes with any code change in any layer, this can't be a reason to do a change in Hadoop :-) |
Description of PR
How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?