Browse Source

HADOOP-12559. KMS connection failures should trigger TGT renewal. Contributed by Zhe Zhang.

Conflicts:
	hadoop-common-project/hadoop-common/CHANGES.txt
Xiaoyu Yao 9 years ago
parent
commit
c6f68a7f98

+ 2 - 0
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java

@@ -474,6 +474,8 @@ public class KMSClientProvider extends KeyProvider implements CryptoExtension,
           UserGroupInformation.AuthenticationMethod.PROXY)
           UserGroupInformation.AuthenticationMethod.PROXY)
                               ? currentUgi.getShortUserName() : null;
                               ? currentUgi.getShortUserName() : null;
 
 
+      // check and renew TGT to handle potential expiration
+      actualUgi.checkTGTAndReloginFromKeytab();
       // creating the HTTP connection using the current UGI at constructor time
       // creating the HTTP connection using the current UGI at constructor time
       conn = actualUgi.doAs(new PrivilegedExceptionAction<HttpURLConnection>() {
       conn = actualUgi.doAs(new PrivilegedExceptionAction<HttpURLConnection>() {
         @Override
         @Override