Skip to content

Commit 00ed104

Browse files
FMXSteNicholas
authored andcommitted
[CELEBORN-1420] Fix mapreduce job will throw an exit exception after it succeeded
### What changes were proposed in this pull request? Set the correct flag to remove a redundant exception. ### Why are the changes needed? To remove a redundant exception. ### Does this PR introduce _any_ user-facing change? NO. ### How was this patch tested? Manually test. Closes #2505 from FMX/b1420. Authored-by: mingji <fengmingxiao.fmx@alibaba-inc.com> Signed-off-by: mingji <fengmingxiao.fmx@alibaba-inc.com>
1 parent d7baa52 commit 00ed104

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

client-mr/mr/src/main/java/org/apache/celeborn/mapreduce/v2/app/MRAppMasterWithCeleborn.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.celeborn.mapreduce.v2.app;
1919

2020
import java.io.IOException;
21+
import java.lang.reflect.Field;
2122

2223
import org.apache.hadoop.fs.FSDataOutputStream;
2324
import org.apache.hadoop.fs.FileStatus;
@@ -149,6 +150,17 @@ public static void main(String[] args) {
149150
Integer.parseInt(nodeHttpPortString),
150151
appSubmitTime,
151152
rmAppConf);
153+
154+
// set this flag to avoid exit exception
155+
try {
156+
Field field = MRAppMaster.class.getDeclaredField("mainStarted");
157+
field.setAccessible(true);
158+
field.setBoolean(null, true);
159+
field.setAccessible(false);
160+
} catch (NoSuchFieldException e) {
161+
// ignore it for compatibility
162+
}
163+
152164
ShutdownHookManager.get()
153165
.addShutdownHook(
154166
() -> {

0 commit comments

Comments
 (0)