Browse Source

HADOOP-1486. Fix so that fatal exceptions in namenode cause it to exit. Contributed by Dhruba.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@555403 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 years ago
parent
commit
8556acd6dd

+ 3 - 0
CHANGES.txt

@@ -315,6 +315,9 @@ Trunk (unreleased changes)
  97. HADOOP-911.  Fix a multithreading bug in libhdfs.
      (Christian Kunz)
 
+ 98. HADOOP-1486.  Fix so that fatal exceptions in namenode cause it
+     to exit.  (Dhruba Borthakur via cutting)
+
 
 Release 0.13.0 - 2007-06-08
 

+ 2 - 3
src/java/org/apache/hadoop/dfs/FSEditLog.java

@@ -429,7 +429,7 @@ class FSEditLog {
           } catch (IOException e) {
             FSNamesystem.LOG.error("Unable to append to edit log. " +
                                    "Fatal Error.");
-            throw new RuntimeException("Unable to append to edit log. ");
+            Runtime.getRuntime().exit(-1);
           }
         }
       }
@@ -466,8 +466,7 @@ class FSEditLog {
           } catch (IOException e) {
             FSNamesystem.LOG.error("Unable to sync edit log. " +
                                    "Fatal Error.");
-            throw new RuntimeException("Unable to sync edit log. " +
-                                       "Fatal Error.");
+            Runtime.getRuntime().exit(-1);
           }
         }
       }

+ 3 - 0
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -1745,6 +1745,9 @@ class FSNamesystem implements FSConstants {
         } catch (InterruptedException ie) {
         } catch (IOException ie) {
           LOG.warn("ReplicationMonitor thread received exception. " + ie);
+        } catch (Throwable t) {
+          LOG.warn("ReplicationMonitor thread received Runtime exception. " + t);
+          Runtime.getRuntime().exit(-1);
         }
       }
     }