Skip to content

Commit

Permalink
[FLINK-25893][runtime] Do not report error if ResourceManagerServiceI…
Browse files Browse the repository at this point in the history
…mpl#deregisterApplication is called when there's no leading RM.
  • Loading branch information
xintongsong committed Feb 21, 2022
1 parent d0c8547 commit 9f1d43b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,8 @@ public CompletableFuture<Void> deregisterApplication(
}

private static CompletableFuture<Void> deregisterWithoutLeaderRm() {
return FutureUtils.completedExceptionally(
new FlinkException(
"Cannot deregister application. Resource manager service is not available."));
LOG.warn("Cannot deregister application. Resource manager service is not available.");
return FutureUtils.completedVoidFuture();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,16 @@ public void deregisterApplication_leaderRmNotStarted() throws Exception {
deregisterApplicationFuture.get(TIMEOUT.getSize(), TIMEOUT.getUnit());
}

@Test
public void deregisterApplication_noLeaderRm() throws Exception {
createAndStartResourceManager();
final CompletableFuture<Void> deregisterApplicationFuture =
resourceManagerService.deregisterApplication(ApplicationStatus.CANCELED, null);

// should not report error
deregisterApplicationFuture.get(TIMEOUT.getSize(), TIMEOUT.getUnit());
}

private static void blockOnFuture(CompletableFuture<?> future) {
try {
future.get();
Expand Down

0 comments on commit 9f1d43b

Please sign in to comment.