From aa15cdf9d4ff31bde754c24fc4bf7cbed855e53d Mon Sep 17 00:00:00 2001 From: Andy Zhang <87735571+Andyz26@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:19:56 -0800 Subject: [PATCH] handle submitted failure --- .../scheduler/ResourceClusterAwareSchedulerActor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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