diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index f10ba51d52..a33315e075 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -288,6 +288,9 @@ Release 2.4.0 - UNRELEASED MAPREDUCE-5693. Restore MRv1 behavior for log flush (Gera Shegalov via jlowe) + MAPREDUCE-5723. MR AM container log can be truncated or empty. + (Mohammad Kamrul Islam via kasha) + Release 2.3.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java index 2bae130a4e..969e2fa7a1 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java @@ -121,6 +121,7 @@ import org.apache.hadoop.service.CompositeService; import org.apache.hadoop.service.Service; import org.apache.hadoop.service.ServiceOperations; +import org.apache.hadoop.util.ExitUtil; import org.apache.hadoop.util.ReflectionUtils; import org.apache.hadoop.util.ShutdownHookManager; import org.apache.hadoop.util.StringInterner; @@ -1405,9 +1406,7 @@ public static void main(String[] args) { initAndStartAppMaster(appMaster, conf, jobUserName); } catch (Throwable t) { LOG.fatal("Error starting MRAppMaster", t); - System.exit(1); - } finally { - LogManager.shutdown(); + ExitUtil.terminate(1, t); } } @@ -1483,4 +1482,11 @@ public Object run() throws Exception { } }); } + + @Override + protected void serviceStop() throws Exception { + super.serviceStop(); + LogManager.shutdown(); + } + }