[
https://issues.apache.org/jira/browse/HADOOP-19308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17888574#comment-17888574
]
ASF GitHub Bot commented on HADOOP-19308:
-----------------------------------------
Abhey opened a new pull request, #7112:
URL: https://github.com/apache/hadoop/pull/7112
### Description of PR
* This PR introduces the changes to the constructor of the
FastSaslClientFactory to set props to an empty HashMap in case null value is
passed.
* Adittionally, This PR adds a try-catch block around the logic where the
factoryCache is being populated. This is being done to prevent a bad
SaslClientFactory from stopping the instantiation of the FastSaslClientFactory
object.
### How was this patch tested?
* We applied this patch in our internal fork and were able to resolve the
issue reported in the JIRA.
### For code changes:
- [x] Does the title or this PR starts with the corresponding JIRA issue id
(e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: have the integration tests been executed and the
endpoint declared according to the connector-specific documentation?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`,
`NOTICE-binary` files?
> FastSaslClientFactory failing to initialise due to NPE
> ------------------------------------------------------
>
> Key: HADOOP-19308
> URL: https://issues.apache.org/jira/browse/HADOOP-19308
> Project: Hadoop Common
> Issue Type: Bug
> Components: common, security
> Affects Versions: 3.4.0, 3.3.6, 3.4.1, 3.4.2
> Environment: RHEL9
> Reporter: Abhey Rana
> Priority: Critical
> Attachments: stacktrace.txt
>
> Original Estimate: 96h
> Remaining Estimate: 96h
>
> FastSaslClientFactory is instantiated in both SaslRpcClient and
> SaslParticipant as new FastSaslClientFactory(null)
> In its constructor FastSaslClientFactory loads all the SaslFactories using
> Sasl.getSaslClientFactories();
> Then it iterates through all the loaded factories and calls getMechanismNames
> method.
> The null argument sent in the constructor is sent to the getMechanismNames
> call.
> In some-cases, a loaded factory might not handle this null argument and might
> throw a NPE.
> This can cause the entire FastSaslClientFactory to not instantiate leading to
> failure while instantiation of SaslRpcClient.
> Code Pointer -
> [https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/FastSaslClientFactory.java#L43]
> Stack Trace -
> {code:java}
> Cause3: java.lang.ExceptionInInitializerError: Exception
> java.lang.NullPointerException [in thread
> "ServiceScheduler:GridforceSfdcLogUploaderProcess"] Cause3-StackTrace: at
> org.apache.qpid.client.security.amqplain.AmqPlainSaslClientFactory.getMechanismNames(AmqPlainSaslClientFactory.java:50)
> at
> org.apache.hadoop.security.FastSaslClientFactory.<init>(FastSaslClientFactory.java:47)
> at
> org.apache.hadoop.security.SaslRpcClient.<clinit>(SaslRpcClient.java:106) at
> org.apache.hadoop.ipc.Client$Connection.setupSaslConnection(Client.java:559)
> at org.apache.hadoop.ipc.Client$Connection.access$2100(Client.java:347) at
> org.apache.hadoop.ipc.Client$Connection$2.run(Client.java:783) at
> org.apache.hadoop.ipc.Client$Connection$2.run(Client.java:779) at
> java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
> at java.base/javax.security.auth.Subject.doAs(Subject.java:439) at
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1899)
> at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:779)
> at org.apache.hadoop.ipc.Client$Connection.access$3800(Client.java:347) at
> org.apache.hadoop.ipc.Client.getConnection(Client.java:1632) at
> org.apache.hadoop.ipc.Client.call(Client.java:1457) at
> org.apache.hadoop.ipc.Client.call(Client.java:1410) at
> org.apache.hadoop.ipc.ProtobufRpcEngine2$Invoker.invoke(ProtobufRpcEngine2.java:258)
> at
> org.apache.hadoop.ipc.ProtobufRpcEngine2$Invoker.invoke(ProtobufRpcEngine2.java:139)
> at jdk.proxy2/jdk.proxy2.$Proxy1500.getFileInfo(Unknown Source) at
> org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.lambda$getFileInfo$41(ClientNamenodeProtocolTranslatorPB.java:811)
> at
> org.apache.hadoop.ipc.internal.ShadedProtobufHelper.ipc(ShadedProtobufHelper.java:160)
> at
> org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:811)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method) at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
> ... 23 shared with parent` {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]