hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Kanter (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-15717) TGT renewal thread does not log IOException
Date Thu, 11 Oct 2018 20:34:00 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-15717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16647003#comment-16647003

Robert Kanter commented on HADOOP-15717:

Good catch [~snemeth].

[~xiaochen], logging the {{Throwable}} only works if you don't use the varargs logging method.
 Java requires that varargs is always last, so you can't have something like {{foo(String
message, String... args, Throwable t)}}.  Doing that in the logging framework compiles because
the varargs are of type {{Object}}, so the Throwable is simply included with those, but because
we don't have as many parameters in the message, it just gets ignored.  

This would explain why we appear to have a log message that prints the stack trace in the
code, but it's not seen in the actual log.  Using {{String.format}} seems like an easy way
to fix this, and I'm pretty sure I've seen us do that elsewhere.

Does that make sense to you [~xiaochen]?

> TGT renewal thread does not log IOException
> -------------------------------------------
>                 Key: HADOOP-15717
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15717
>             Project: Hadoop Common
>          Issue Type: Improvement
>            Reporter: Szilard Nemeth
>            Assignee: Szilard Nemeth
>            Priority: Major
>         Attachments: HADOOP-15717.001.patch, HADOOP-15717.002.patch
> I came across a case where tgt.getEndTime() was returned null and it resulted in an NPE,
this observation was popped out of a test suite execution on a cluster. The reason for logging
the {{IOException}} is that it helps to troubleshoot what caused the exception, as it can
come from two different calls from the try-catch.
> I can see that [~gabor.bota] handled this with HADOOP-15593, but apart from logging the
fact that the ticket's {{endDate}} was null, we have not logged the exception at all.
> With the current code, the exception is swallowed and the thread terminates in case the
ticket's {{endDate}} is null. 
> As this can happen with OpenJDK for example, it is required to print the exception (stack
trace, message) to the log.
> The code should be updated here: https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java#L918

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org

View raw message