소스 검색

HADOOP-15717. TGT renewal thread does not log IOException (snemeth via rkanter)

Robert Kanter 6 년 전
부모
커밋
d91d47bc73
1개의 변경된 파일10개의 추가작업 그리고 8개의 파일을 삭제
  1. 10 8
      hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java

+ 10 - 8
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java

@@ -920,8 +920,8 @@ public class UserGroupInformation {
           final long now = Time.now();
 
           if (tgt.isDestroyed()) {
-            LOG.error("TGT is destroyed. Aborting renew thread for {}.",
-                getUserName());
+            LOG.error(String.format("TGT is destroyed. " +
+                    "Aborting renew thread for %s.", getUserName()), ie);
             return;
           }
 
@@ -933,16 +933,18 @@ public class UserGroupInformation {
           try {
             tgtEndTime = tgt.getEndTime().getTime();
           } catch (NullPointerException npe) {
-            LOG.error("NPE thrown while getting KerberosTicket endTime. "
-                + "Aborting renew thread for {}.", getUserName());
+            LOG.error(String.format("NPE thrown while getting " +
+                "KerberosTicket endTime. Aborting renew thread for %s.",
+                getUserName()), ie);
             return;
           }
 
-          LOG.warn("Exception encountered while running the renewal "
-                  + "command for {}. (TGT end time:{}, renewalFailures: {},"
-                  + "renewalFailuresTotal: {})", getUserName(), tgtEndTime,
+          LOG.warn(String.format("Exception encountered while running the " +
+                  "renewal command for %s. " +
+                  "(TGT end time:%d, renewalFailures: %d, " +
+                  "renewalFailuresTotal: %d)", getUserName(), tgtEndTime,
               metrics.renewalFailures.value(),
-              metrics.renewalFailuresTotal.value(), ie);
+              metrics.renewalFailuresTotal.value()), ie);
           if (rp == null) {
             // Use a dummy maxRetries to create the policy. The policy will
             // only be used to get next retry time with exponential back-off.