dengzhhu653 commented on code in PR #5851:
URL: https://github.com/apache/hive/pull/5851#discussion_r2678280309


##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/security/HadoopThriftAuthBridge.java:
##########
@@ -646,11 +648,16 @@ public void process(final TProtocol inProt, final 
TProtocol outProt) throws TExc
          }
        }
 
-       UserGroupInformation clientUgi = null;
        try {
          if (useProxy) {
-           clientUgi = UserGroupInformation.createProxyUser(
-               endUser, UserGroupInformation.getLoginUser());
+           UserGroupInformation clientUgi =
+               UserGroupInformation.createProxyUser(endUser, 
UserGroupInformation.getLoginUser());
+           if (inProt.getTransport() instanceof TUGIContainingTransport 
ugiTransport) {
+             if (ugiTransport.getClientUGI() == null) {
+               ugiTransport.setClientUGI(clientUgi);
+             }
+             clientUgi = ugiTransport.getClientUGI();

Review Comment:
   The ugi is identical: 
https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java#L483-L491,
   reuse the ugi cached in ugiTransport if possible so the connection will get 
the same FileSystem instance from cache in the whole lifetime
   



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -4528,23 +3571,30 @@ public AddPartitionsResult 
add_partitions_req(AddPartitionsRequest request)
       // Make sure all the partitions have the catalog set as well
       request.getParts().forEach(p -> p.setCatName(catName));
       request.setCatName(catName);

Review Comment:
   ack



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