HDFS-11849. JournalNode startup failure exception should be logged in log file. Contributed By Surendra Singh Lilhore.

This commit is contained in:
Brahma Reddy Battula 2017-05-23 02:39:19 +08:00
parent 2a8fcf0c9a
commit 9cab42cc79
1 changed files with 8 additions and 1 deletions

View File

@ -17,6 +17,8 @@
*/ */
package org.apache.hadoop.hdfs.qjournal.server; package org.apache.hadoop.hdfs.qjournal.server;
import static org.apache.hadoop.util.ExitUtil.terminate;
import java.io.File; import java.io.File;
import java.io.FileFilter; import java.io.FileFilter;
import java.io.IOException; import java.io.IOException;
@ -330,7 +332,12 @@ public void reportErrorOnFile(File f) {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
StringUtils.startupShutdownMessage(JournalNode.class, args, LOG); StringUtils.startupShutdownMessage(JournalNode.class, args, LOG);
try {
System.exit(ToolRunner.run(new JournalNode(), args)); System.exit(ToolRunner.run(new JournalNode(), args));
} catch (Throwable e) {
LOG.error("Failed to start journalnode.", e);
terminate(-1, e);
}
} }
public void doPreUpgrade(String journalId) throws IOException { public void doPreUpgrade(String journalId) throws IOException {