diff --git a/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/server/master/scheduler/ResourceClusterAwareSchedulerActor.java b/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/server/master/scheduler/ResourceClusterAwareSchedulerActor.java index 5329aa980..f3999ac32 100644 --- a/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/server/master/scheduler/ResourceClusterAwareSchedulerActor.java +++ b/mantis-control-plane/mantis-control-plane-server/src/main/java/io/mantisrx/server/master/scheduler/ResourceClusterAwareSchedulerActor.java @@ -288,7 +288,7 @@ private void onSubmittedScheduleRequestEvent(SubmittedScheduleRequestEvent event try { final TaskExecutorRegistration info = resourceCluster.getTaskExecutorInfo(taskExecutorID) .join(); - boolean success = + boolean success = //todo this return state is not wired to actual processing jobMessageRouter.routeWorkerEvent(new WorkerLaunched( event.getEvent().getRequest().getWorkerId(), event.getEvent().getRequest().getStageNum(), @@ -308,6 +308,7 @@ private void onSubmittedScheduleRequestEvent(SubmittedScheduleRequestEvent event } } catch (Exception ex) { log.warn("Failed to route message due to error in getting TaskExecutor info: {}", taskExecutorID, ex); + self().tell(event.onFailure(ex), self()); } } @@ -520,6 +521,11 @@ private static class SubmittedScheduleRequestEvent { ScheduleRequestEvent event; TaskExecutorID taskExecutorID; + + FailedToScheduleRequestEvent onFailure(Throwable throwable) { + return new FailedToScheduleRequestEvent( + this.event, 1, ExceptionUtils.stripCompletionException(throwable)); + } } @Value