Skip to content

Commit

Permalink
move graceful shutdown to s3 load
Browse files Browse the repository at this point in the history
  • Loading branch information
eaypek-tfh committed Jan 24, 2025
1 parent 08a202a commit dfb6221
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion deploy/stage/common-values-iris-mpc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: "ghcr.io/worldcoin/iris-mpc:c2e7d7a099f189ecedea11947c34d55965b41f7c"
image: "ghcr.io/worldcoin/iris-mpc:e4a7a3b109d6b8b03708c5f7e85f3e17ad42b08b"

environment: stage
replicaCount: 1
Expand Down
9 changes: 4 additions & 5 deletions iris-mpc/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,6 @@ async fn server_main(config: Config) -> eyre::Result<()> {
let db_chunks_bucket_name = config.db_chunks_bucket_name.clone();
let db_chunks_folder_name = config.db_chunks_folder_name.clone();
let download_shutdown_handler = Arc::clone(&shutdown_handler);
let env = config.environment.clone();

let (tx, rx) = oneshot::channel();
background_tasks.spawn_blocking(move || {
Expand Down Expand Up @@ -1255,10 +1254,6 @@ async fn server_main(config: Config) -> eyre::Result<()> {
load_chunks_parallelism
);
load_summary_ts = Instant::now();
if download_shutdown_handler.is_shutting_down() {
tracing::warn!("Shutdown requested by shutdown_handler.");
return Err(eyre::eyre!("Shutdown requested"));
}
}

let min_last_modified_at = last_snapshot_details.timestamp
Expand Down Expand Up @@ -1342,6 +1337,10 @@ async fn server_main(config: Config) -> eyre::Result<()> {
elapsed,
record_counter as f64 / elapsed.as_secs_f64()
);
if download_shutdown_handler.is_shutting_down() {
tracing::warn!("Shutdown requested by shutdown_handler.");
return Err(eyre::eyre!("Shutdown requested"));
}
}

time_loading_into_memory += load_summary_ts.elapsed();
Expand Down

0 comments on commit dfb6221

Please sign in to comment.