Skip to content

Commit

Permalink
[CELEBORN-1420] Fix mapreduce job will throw an exit exception after …
Browse files Browse the repository at this point in the history
…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 <[email protected]>
Signed-off-by: mingji <[email protected]>
  • Loading branch information
FMX authored and SteNicholas committed May 14, 2024
1 parent d7baa52 commit 00ed104
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.celeborn.mapreduce.v2.app;

import java.io.IOException;
import java.lang.reflect.Field;

import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileStatus;
Expand Down Expand Up @@ -149,6 +150,17 @@ public static void main(String[] args) {
Integer.parseInt(nodeHttpPortString),
appSubmitTime,
rmAppConf);

// set this flag to avoid exit exception
try {
Field field = MRAppMaster.class.getDeclaredField("mainStarted");
field.setAccessible(true);
field.setBoolean(null, true);
field.setAccessible(false);
} catch (NoSuchFieldException e) {
// ignore it for compatibility
}

ShutdownHookManager.get()
.addShutdownHook(
() -> {
Expand Down

0 comments on commit 00ed104

Please sign in to comment.