abstractdog commented on code in PR #3626:
URL: https://github.com/apache/hive/pull/3626#discussion_r1041229232
##########
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskCommunicator.java:
##########
@@ -190,31 +173,46 @@ public LlapTaskCommunicator(
}
}
+ @SuppressWarnings("unchecked")
+ private Token<LlapTokenIdentifier> getLlapToken() {
+ Token<LlapTokenIdentifier> token = null;
+ Credentials credentials = getContext().getAMCredentials();
+ if (credentials != null) {
+ token = (Token<LlapTokenIdentifier>)
credentials.getToken(LlapTokenIdentifier.KIND_NAME);
+ }
+ Preconditions.checkState((token != null) ==
UserGroupInformation.isSecurityEnabled());
+ LOG.info("Task communicator with a token {}", token);
+ return token;
+ }
+
void setScheduler(LlapTaskSchedulerService peer) {
this.scheduler = peer;
}
private static final String LLAP_TOKEN_NAME =
LlapTokenIdentifier.KIND_NAME.toString();
- /**
- * @return true iff the error is fatal and we should give up on everything.
- */
- private boolean processSendError(Throwable t) {
+ private void processSendError(Throwable t) {
Throwable cause = t;
while (cause != null) {
- if (cause instanceof RetriableException) return false;
- if (((cause instanceof InvalidToken && cause.getMessage() != null)
- || (cause instanceof RemoteException && cause.getCause() == null
- && cause.getMessage() != null &&
cause.getMessage().contains("InvalidToken")))
- && cause.getMessage().contains(LLAP_TOKEN_NAME)) {
- break;
+ if (isInvalidTokenError(cause)) {
+ handleInvalidToken(cause);
+ return;
}
cause = cause.getCause();
}
- if (cause == null) return false;
- LOG.error("Reporting fatal error - LLAP token appears to be invalid.", t);
- getContext().reportError(ServicePluginErrorDefaults.OTHER_FATAL,
cause.getMessage(), null);
- return true;
+ }
+
+ private boolean isInvalidTokenError(Throwable cause) {
+ LOG.debug("Checking for invalid token error, cause: {}, cause.getCause():
{}", cause, cause.getCause());
+ /*
+ * The lastest message discovered (while doing HIVE-26569) for a
RemoteException is:
+ * "Current (LLAP_TOKEN; LLAP_TOKEN owner=hive/***, renewer=hive,
realUser=, issueDate=1670317803579, maxDate=1671527403579,
+ * sequenceNumber=297, masterKeyId=296, cluster ***, app ID , signing
false) can't be found in cache"
+ */
+ return cause.getMessage().contains(LLAP_TOKEN_NAME)
Review Comment:
it's checked later in this epic condition, I'm changing order to have null
check first:
```
cause.getMessage() != null
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]