Skip to content

Commit

Permalink
Add graceful shutdown for health check failures (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielle-tfh authored Jan 13, 2025
1 parent 45926ec commit 27d32d3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions iris-mpc/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,11 +874,21 @@ async fn server_main(config: Config) -> eyre::Result<()> {
tracing::warn!("Node {} did not respond with success, retrying...", host);
continue;
}
// The other node seems to be down or returned an error.
panic!(
"Node {} did not respond with success, killing server...",
tracing::info!(
"Node {} did not respond with success, starting graceful shutdown",
host
);

if !heartbeat_shutdown_handler.is_shutting_down() {
heartbeat_shutdown_handler.trigger_manual_shutdown();
tracing::error!(
"Node {} has not completed health check, therefore graceful shutdown \
has been triggered",
host
);
} else {
tracing::info!("Node {} has already started graceful shutdown.", host);
}
}

let probe_response = res
Expand Down

0 comments on commit 27d32d3

Please sign in to comment.