hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sameer Abhyankar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-9507) LeaseRenewer Logging Under-Reporting
Date Thu, 25 Aug 2016 23:04:20 GMT

    [ https://issues.apache.org/jira/browse/HDFS-9507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15438051#comment-15438051
] 

Sameer Abhyankar commented on HDFS-9507:
----------------------------------------

Hello - I was looking through the code for this and it seems that DFSClient#renewLease() will
only return a false when either the client is not running or there are no files being written.
Otherwise DFSClient#renewLease will either renew the lease successfully and return "true"
or it will throw an Exception (which will bubble up). The behavior of LeaseRenewer#renew to
either log a warning or bubble up the Exception would be valid, correct?

As for the LOG level, I agree it should be logged as a warn instead of a debug.

> LeaseRenewer Logging Under-Reporting
> ------------------------------------
>
>                 Key: HDFS-9507
>                 URL: https://issues.apache.org/jira/browse/HDFS-9507
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>    Affects Versions: 2.7.1
>            Reporter: BELUGA BEHR
>            Priority: Minor
>
> Why is it that in LeaseRenewer#run() failures to renew a lease on a file are reported
with "warn" level logging, but in LeaseRenewer#renew() it is reported with a "debug" level
warn?
> In LeaseRenewer#renew(), if the method renewLease() returns 'false' then the problem
is silently discarded (continue, no Exception is thrown) and the next client in the list tries
to renew.
> {code:title=LeaseRenewer.java|borderStyle=solid}
> private void run(final int id) throws InterruptedException {
>   ...
>   try {
>     renew();
>     lastRenewed = Time.monotonicNow();
>   } catch (SocketTimeoutException ie) {
>     LOG.warn("Failed to renew lease for " + clientsString() + " for "
>     + (elapsed/1000) + " seconds.  Aborting ...", ie);
>     synchronized (this) {
>       while (!dfsclients.isEmpty()) {
>         DFSClient dfsClient = dfsclients.get(0);
>         dfsClient.closeAllFilesBeingWritten(true);
>         closeClient(dfsClient);
>       }
>       //Expire the current LeaseRenewer thread.
>       emptyTime = 0;
>     }
>     break;
>   } catch (IOException ie) {
>     LOG.warn("Failed to renew lease for " + clientsString() + " for "
>       + (elapsed/1000) + " seconds.  Will retry shortly ...", ie);
>   }
> }
> ...
> }
> private void renew() throws IOException {
> {
>    ...
>         if (!c.renewLease()) {
>           LOG.debug("Did not renew lease for client {}", c);
>           continue;
>         }
>    ...
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message