Skip to content

Commit

Permalink
[FLINK-19022] Let TaskExecutor, Dispatcher, RM fail fatally if onStar…
Browse files Browse the repository at this point in the history
…t throws a Throwable

If TaskExecutor., Dispatcher. or ResourceManager.onStart throws a Throwable, the system is
no longer in a valid state. Hence, this commit ensures that the components will properly
call FatalErrorHandler.onFatalError in such a case.
  • Loading branch information
tillrohrmann committed Oct 20, 2020
1 parent 806b9f3 commit 9e31510
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ public CompletableFuture<ApplicationStatus> getShutDownFuture() {
public void onStart() throws Exception {
try {
startDispatcherServices();
} catch (Exception e) {
final DispatcherException exception = new DispatcherException(String.format("Could not start the Dispatcher %s", getAddress()), e);
} catch (Throwable t) {
final DispatcherException exception = new DispatcherException(String.format("Could not start the Dispatcher %s", getAddress()), t);
onFatalError(exception);
throw exception;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ public ResourceManager(
public final void onStart() throws Exception {
try {
startResourceManagerServices();
} catch (Exception e) {
final ResourceManagerException exception = new ResourceManagerException(String.format("Could not start the ResourceManager %s", getAddress()), e);
} catch (Throwable t) {
final ResourceManagerException exception = new ResourceManagerException(String.format("Could not start the ResourceManager %s", getAddress()), t);
onFatalError(exception);
throw exception;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ public CompletableFuture<Collection<LogInfo>> requestLogList(Time timeout) {
public void onStart() throws Exception {
try {
startTaskExecutorServices();
} catch (Exception e) {
final TaskManagerException exception = new TaskManagerException(String.format("Could not start the TaskExecutor %s", getAddress()), e);
} catch (Throwable t) {
final TaskManagerException exception = new TaskManagerException(String.format("Could not start the TaskExecutor %s", getAddress()), t);
onFatalError(exception);
throw exception;
}
Expand Down

0 comments on commit 9e31510

Please sign in to comment.