pan3793 commented on issue #4762:
URL: https://github.com/apache/kyuubi/issues/4762#issuecomment-1522963178

   This is caused by https://github.com/apache/kyuubi/pull/3604, since 1.7.0, 
Kyuubi propagates env var `HADOOP_PROXY_USER` to Flink process on launching 
Flink engine, when detected this env var, Hive will call `getDelegationToken` 
on initializing HMS client.
   
   ```
       //If HADOOP_PROXY_USER is set in env or property,
       //then need to create metastore client that proxies as that user.
       String HADOOP_PROXY_USER = "HADOOP_PROXY_USER";
       String proxyUser = System.getenv(HADOOP_PROXY_USER);
       if (proxyUser == null) {
         proxyUser = System.getProperty(HADOOP_PROXY_USER);
       }
       //if HADOOP_PROXY_USER is set, create DelegationToken using real user
       if(proxyUser != null) {
         LOG.info(HADOOP_PROXY_USER + " is set. Using delegation "
             + "token for HiveMetaStore connection.");
         try {
           UserGroupInformation.getLoginUser().getRealUser().doAs(
               new PrivilegedExceptionAction<Void>() {
                 @Override
                 public Void run() throws Exception {
                   open();
                   return null;
                 }
               });
           String delegationTokenPropString = 
"DelegationTokenForHiveMetaStoreServer";
           String delegationTokenStr = getDelegationToken(proxyUser, proxyUser);
           Utils.setTokenStr(UserGroupInformation.getCurrentUser(), 
delegationTokenStr,
               delegationTokenPropString);
           this.conf.setVar(ConfVars.METASTORE_TOKEN_SIGNATURE, 
delegationTokenPropString);
           close();
         } catch (Exception e) {
           LOG.error("Error while setting delegation token for " + proxyUser, 
e);
           if(e instanceof MetaException) {
             throw (MetaException)e;
           } else {
             throw new MetaException(e.getMessage());
           }
         }
       }
   ```


-- 
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]

Reply via email to