From 7e197996bd6a3bab4ec2ea37c34de4a3fd198612 Mon Sep 17 00:00:00 2001 From: Jonah Eisen Date: Tue, 28 Nov 2023 13:50:49 -0800 Subject: [PATCH] Show job failure message on preview page The existing error message is misleading because the Errors tab only shows user errors, not compilation errors. --- arroyo-console/src/routes/pipelines/CreatePipeline.tsx | 4 ++-- arroyo-controller/src/states/compiling.rs | 2 +- arroyo-controller/src/states/running.rs | 2 +- arroyo-controller/src/states/scheduling.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arroyo-console/src/routes/pipelines/CreatePipeline.tsx b/arroyo-console/src/routes/pipelines/CreatePipeline.tsx index ba880a2b8..7a5b4c290 100644 --- a/arroyo-console/src/routes/pipelines/CreatePipeline.tsx +++ b/arroyo-console/src/routes/pipelines/CreatePipeline.tsx @@ -575,7 +575,7 @@ export function CreatePipeline() { } else { errorsTab = ( - Compilation and job errors will appear here. + Job errors will appear here. ); } @@ -608,7 +608,7 @@ export function CreatePipeline() { } else if (udfValidationApiError) { errorMessage = formatError(udfValidationApiError); } else if (job?.state == 'Failed') { - errorMessage = 'Job failed. See "Errors" tab for more details.'; + errorMessage = job.failureMessage ?? 'Job failed.'; } else { errorMessage = ''; } diff --git a/arroyo-controller/src/states/compiling.rs b/arroyo-controller/src/states/compiling.rs index 95b4d1dfc..7ebc3a26c 100644 --- a/arroyo-controller/src/states/compiling.rs +++ b/arroyo-controller/src/states/compiling.rs @@ -42,7 +42,7 @@ impl State for Compiling { }); loop { tokio::select! { - val = &mut rx => match val.map_err(|err| fatal("could not compile", err.into()))? { + val = &mut rx => match val.map_err(|err| fatal("Could not compile", err.into()))? { Ok(res) => { ctx.status.pipeline_path = Some(res.pipeline_path); ctx.status.wasm_path = Some(res.wasm_path); diff --git a/arroyo-controller/src/states/running.rs b/arroyo-controller/src/states/running.rs index 77019a42e..4182ae11d 100644 --- a/arroyo-controller/src/states/running.rs +++ b/arroyo-controller/src/states/running.rs @@ -113,7 +113,7 @@ impl State for Running { error!(message = "error while running", error = format!("{:?}", err), job_id = ctx.config.id); if ctx.status.restarts >= RESTARTS_ALLOWED as i32 { return Err(fatal( - "too many job failures", + "Job has restarted too many times", err )); } diff --git a/arroyo-controller/src/states/scheduling.rs b/arroyo-controller/src/states/scheduling.rs index d90d19386..c0a9aded1 100644 --- a/arroyo-controller/src/states/scheduling.rs +++ b/arroyo-controller/src/states/scheduling.rs @@ -187,7 +187,7 @@ impl Scheduling { ); if start.elapsed() > STARTUP_TIME { return Err(fatal( - "could not get enough slots", + "Not enough slots to schedule job", anyhow!("scheduler error -- needed {} slots", slots_needed), )); }