You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Hadoop QA (JIRA)" <ji...@apache.org> on 2015/05/03 07:27:06 UTC

[jira] [Commented] (HADOOP-11328) ZKFailoverController.java does not log Exception and causes latent problems during failover

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

Hadoop QA commented on HADOOP-11328:
------------------------------------

\\
\\
| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | pre-patch |  14m 37s | Pre-patch trunk compilation is healthy. |
| {color:green}+1{color} | @author |   0m  0s | The patch does not contain any @author tags. |
| {color:red}-1{color} | tests included |   0m  0s | The patch doesn't appear to include any new or modified tests.  Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. |
| {color:green}+1{color} | javac |   7m 31s | There were no new javac warning messages. |
| {color:green}+1{color} | javadoc |   9m 32s | There were no new javadoc warning messages. |
| {color:green}+1{color} | release audit |   0m 22s | The applied patch does not increase the total number of release audit warnings. |
| {color:green}+1{color} | checkstyle |   1m  5s | There were no new checkstyle issues. |
| {color:green}+1{color} | whitespace |   0m  0s | The patch has no lines that end in whitespace. |
| {color:green}+1{color} | install |   1m 33s | mvn install still works. |
| {color:green}+1{color} | eclipse:eclipse |   0m 32s | The patch built with eclipse:eclipse. |
| {color:green}+1{color} | findbugs |   1m 40s | The patch does not introduce any new Findbugs (version 2.0.3) warnings. |
| {color:green}+1{color} | common tests |  23m  8s | Tests passed in hadoop-common. |
| | |  60m  4s | |
\\
\\
|| Subsystem || Report/Notes ||
| Patch URL | http://issues.apache.org/jira/secure/attachment/12683258/ZKFailoverController.log.exception.1.patch |
| Optional Tests | javadoc javac unit findbugs checkstyle |
| git revision | trunk / e8d0ee5 |
| hadoop-common test log | https://builds.apache.org/job/PreCommit-HADOOP-Build/6451/artifact/patchprocess/testrun_hadoop-common.txt |
| Test Results | https://builds.apache.org/job/PreCommit-HADOOP-Build/6451/testReport/ |
| Java | 1.7.0_55 |
| uname | Linux asf901.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux |
| Console output | https://builds.apache.org/job/PreCommit-HADOOP-Build/6451/console |


This message was automatically generated.

> ZKFailoverController.java does not log Exception and causes latent problems during failover
> -------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-11328
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11328
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: ha
>    Affects Versions: 2.5.1
>            Reporter: Tianyin Xu
>         Attachments: ZKFailoverController.log.exception.1.patch
>
>
> In _ZKFailoverController.java_, the _Exception_ caught by the _run()_ method does not have a single error log. This causes latent problems that are only manifested during failover.
> h5. The problem we encountered
> An _Exception_ is thrown from the _doRun()_ method during _initHM()_ (caused by a configuration error). If you want to repeat, you can set 
> "_ha.health-monitor.connect-retry-interval.ms_" to be any nonsensical value.
> {code:title=ZKFailoverController.java|borderStyle=solid}
>   private int doRun(String[] args)
>     ...
>     initRPC();
>     initHM();
>     startRPC();
>     ....
>   }
> {code}
> The Exception is caught in the _run()_ method, as follows,
> {code:title=ZKFailoverController.java|borderStyle=solid}
>   public int run(final String[] args) throws Exception {
>     ...
>     try {
>       ...
>         @Override
>         public Integer run() {
>           try {
>             return doRun(args);
>           } catch (Exception t) {
>             throw new RuntimeException(t);
>           } finally {
>             if (elector != null) {
>               elector.terminateConnection();
>             }
>           }
>         }
>       });
>     } catch (RuntimeException rte) {
>       throw (Exception)rte.getCause();
>     }
>   }
> {code}
> Unfortunately, the Exception (causing the shutdown of the process) is *not logged at all*. This causes latent errors which is only manifested during failover (because ZKFC is dead). The tricky thing here is that everything looks perfectly fine: the _jps_ command shows a running DFSZKFailoverController process and the two NameNode (active and standby) work fine. 
> h5. Patch
> We strongly suggest to add a error log to notify the error caught, such as,
> --- hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java	(revision 1641307)
> +++ hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/ZKFailoverController.java	(working copy)
> {code:title=@@ -178,6 +178,7 @@|borderStyle=solid}
>          }
>        });
>      } catch (RuntimeException rte) {
> +      LOG.fatal("The failover controller encounters runtime error: " + rte);
>        throw (Exception)rte.getCause();
>      }
>    }
> {code}
> Thanks!



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