From d91d47bc739f23ca22a7e44fc83d449db57ab130 Mon Sep 17 00:00:00 2001 From: Robert Kanter Date: Thu, 11 Oct 2018 15:34:41 -0700 Subject: [PATCH] HADOOP-15717. TGT renewal thread does not log IOException (snemeth via rkanter) --- .../hadoop/security/UserGroupInformation.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java index db8810620c..915d6df9e5 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java +++ b/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.