Browse Source

commit c85d8db0bb4a9714de6a8cb1d6816c65806eb9b7
Author: Mahadev Konar <mahadev@cdev6022.inktomisearch.com>
Date: Tue Oct 20 23:47:06 2009 +0000

MAPREDUCE-826 from https://issues.apache.org/jira/secure/attachment/12419080/mapreduce-826-2.patch

+++ b/YAHOO-CHANGES.txt
+ MAPREDUCE-826. harchive doesn't use ToolRunner / harchive returns 0 even
+ if the job fails with exception (koji via mahadev)
+


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077026 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 years ago
parent
commit
fed24552d6
1 changed files with 8 additions and 3 deletions
  1. 8 3
      src/tools/org/apache/hadoop/tools/HadoopArchives.java

+ 8 - 3
src/tools/org/apache/hadoop/tools/HadoopArchives.java

@@ -675,11 +675,16 @@ public class HadoopArchives implements Tool {
   public static void main(String[] args) {
     JobConf job = new JobConf(HadoopArchives.class);
     HadoopArchives harchives = new HadoopArchives(job);
-    try {
-      int res = harchives.run(args);
-      System.exit(res);
+    int ret = 0;
+
+    try{
+      ret = ToolRunner.run(harchives, args);
     } catch(Exception e) {
+      LOG.debug("Exception in archives  ", e);
+      System.err.println("Exception in archives");
       System.err.println(e.getLocalizedMessage());
+      System.exit(1);
     }
+    System.exit(ret);
   }
 }