Skip to content

Commit

Permalink
[YARN-11776] Handle NPE in the RMDelegationTokenIdentifier if localSe…
Browse files Browse the repository at this point in the history
…rviceAddress is null (#7431) Contributed by Abhey Rana.

Reviewed-by: Viraj Jasani <[email protected]>
Signed-off-by: Shilun Fan <[email protected]>
  • Loading branch information
Abhey authored Mar 6, 2025
1 parent f0430f2 commit d7a462f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.InetAddress;

import org.apache.hadoop.classification.InterfaceAudience.Private;
import org.apache.hadoop.classification.InterfaceAudience.Public;
Expand Down Expand Up @@ -139,9 +140,10 @@ private static ApplicationClientProtocol getRmClient(Token<?> token,
String[] services = token.getService().toString().split(",");
for (String service : services) {
InetSocketAddress addr = NetUtils.createSocketAddr(service);
if (localSecretManager != null) {
if (localSecretManager != null && localServiceAddress != null) {
// return null if it's our token
if (localServiceAddress.getAddress().isAnyLocalAddress()) {
InetAddress localServiceAddr = localServiceAddress.getAddress();
if (localServiceAddr != null && localServiceAddr.isAnyLocalAddress()) {
if (NetUtils.isLocalAddress(addr.getAddress()) &&
addr.getPort() == localServiceAddress.getPort()) {
return null;
Expand Down

0 comments on commit d7a462f

Please sign in to comment.