[ 
https://issues.apache.org/jira/browse/HIVE-26569?focusedWorklogId=831495&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-831495
 ]

ASF GitHub Bot logged work on HIVE-26569:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 06/Dec/22 16:59
            Start Date: 06/Dec/22 16:59
    Worklog Time Spent: 10m 
      Work Description: 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
   ```





Issue Time Tracking
-------------------

    Worklog Id:     (was: 831495)
    Time Spent: 2h 50m  (was: 2h 40m)

> Support renewal and recreation of LLAP_TOKENs
> ---------------------------------------------
>
>                 Key: HIVE-26569
>                 URL: https://issues.apache.org/jira/browse/HIVE-26569
>             Project: Hive
>          Issue Type: Improvement
>            Reporter: László Bodor
>            Assignee: László Bodor
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to