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

This commit is contained in:
Robert Kanter 2018-10-11 15:34:41 -07:00
parent 64f2b32d57
commit d91d47bc73

View File

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