Skip to content

Commit 101fcf4

Browse files
committed
pipeline-manager: deployment check
The runner writes deployment check outcomes to the runner log and the pipeline log. The check informs about the resources provisioned for the deployment. This information is useful for debugging. Signed-off-by: Simon Kassing <simon.kassing@feldera.com>
1 parent 93c2cf2 commit 101fcf4

File tree

7 files changed

+213
-100
lines changed

7 files changed

+213
-100
lines changed

crates/feldera-types/src/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ impl ErrorResponse {
6868
response.error_code,
6969
response.message
7070
);
71+
} else if error.status_code() == StatusCode::SERVICE_UNAVAILABLE {
72+
info!(
73+
"[HTTP error] {} {}: {}",
74+
error.status_code(),
75+
response.error_code,
76+
response.message
77+
);
7178
} else {
7279
// All other status responses should not occur in the implementation,
7380
// and thus are logged as errors. Many of the implementation errors are

crates/pipeline-manager/src/api/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,9 @@ pub fn log_response(
345345
} else {
346346
Level::Debug
347347
}
348-
} else if response.status().is_client_error() {
348+
} else if response.status().is_client_error()
349+
|| response.status() == StatusCode::SERVICE_UNAVAILABLE
350+
{
349351
Level::Info
350352
} else {
351353
Level::Error

crates/pipeline-manager/src/integration_test.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ use crate::config::PgEmbedConfig;
5858
use crate::db::storage_postgres::StoragePostgres;
5959
use crate::db::types::program::{CompilationProfile, ProgramConfig, ProgramStatus};
6060
use crate::runner::local_runner::LocalRunner;
61+
use crate::runner::pipeline_executor::LOGS_END_MESSAGE;
6162
use crate::{
6263
config::{ApiServerConfig, CompilerConfig, DatabaseConfig, LocalRunnerConfig},
6364
db::types::pipeline::PipelineStatus,
@@ -2685,20 +2686,13 @@ async fn pipeline_logs() {
26852686
assert_eq!(response_logs_running.status(), StatusCode::OK);
26862687
let logs1 = String::from_utf8(response_logs_paused.body().await.unwrap().to_vec()).unwrap();
26872688
let logs2 = String::from_utf8(response_logs_running.body().await.unwrap().to_vec()).unwrap();
2688-
// It might take time for the logs to become available or upon shutdown they become
2689-
// no longer available, as such any of these three endings is possible
2689+
let normal_ending = format!("{}\n", LOGS_END_MESSAGE);
26902690
assert!(
2691-
logs1.ends_with("LOG STREAM END: pipeline is being shutdown\n")
2692-
|| logs1.ends_with("LOG STREAM END: stdout and stderr are finished\n")
2693-
|| logs1.ends_with("LOG STREAM END: no longer available, please try again later\n")
2694-
|| logs1.ends_with("LOG STREAM UNAVAILABLE: please try again later\n"),
2691+
logs1.ends_with(&normal_ending),
26952692
"Unexpected logs ending: {logs1}"
26962693
);
26972694
assert!(
2698-
logs2.ends_with("LOG STREAM END: pipeline is being shutdown\n")
2699-
|| logs2.ends_with("LOG STREAM END: stdout and stderr are finished\n")
2700-
|| logs2.ends_with("LOG STREAM END: no longer available, please try again later\n")
2701-
|| logs2.ends_with("LOG STREAM UNAVAILABLE: please try again later\n"),
2695+
logs2.ends_with(&normal_ending),
27022696
"Unexpected logs ending: {logs2}"
27032697
);
27042698

crates/pipeline-manager/src/runner/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ impl Display for RunnerError {
237237
)
238238
}
239239
Self::RunnerDeploymentProvisionError { error } => {
240-
write!(f, "Deployment provisioning failed: {error}")
240+
write!(f, "Deployment provision operation failed: {error}")
241241
}
242242
Self::RunnerDeploymentCheckError { error } => {
243-
write!(f, "Deployment check failed: {error}")
243+
write!(f, "Deployment check failed: one or more deployment resources encountered a fatal error.\n\n{error}")
244244
}
245245
Self::RunnerDeploymentShutdownError { error } => {
246246
write!(f, "Deployment shutdown failed (will retry): {error}")

0 commit comments

Comments
 (0)