diff options
author | Alex Auvolat <alex@adnab.me> | 2023-09-27 13:11:52 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-09-27 13:11:52 +0200 |
commit | ad82035b98ba1e5c8301afb4b4568b18e0151f3b (patch) | |
tree | ed17e0139779cb08789d1c40d1b13f34754e242b /src/garage | |
parent | aa7eadc799ebd0d668ff29b155255acfdfa1d9b5 (diff) | |
parent | 3a0e07404707568dabb13cecaf79e0466c5fc296 (diff) | |
download | garage-ad82035b98ba1e5c8301afb4b4568b18e0151f3b.tar.gz garage-ad82035b98ba1e5c8301afb4b4568b18e0151f3b.zip |
Merge branch 'main' into next
Diffstat (limited to 'src/garage')
-rw-r--r-- | src/garage/server.rs | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/garage/server.rs b/src/garage/server.rs index 958089c6..472616c7 100644 --- a/src/garage/server.rs +++ b/src/garage/server.rs @@ -130,20 +130,27 @@ pub async fn run_server(config_file: PathBuf, secrets: Secrets) -> Result<(), Er warn!("This Garage version is built without the metrics feature"); } - // Stuff runs - - // When a cancel signal is sent, stuff stops - - // Collect stuff - for (desc, join_handle) in servers { - if let Err(e) = join_handle.await? { - error!("{} server exited with error: {}", desc, e); - } else { - info!("{} server exited without error.", desc); + if servers.is_empty() { + // Nothing runs except netapp (not in servers) + // Await shutdown signal before proceeding to shutting down netapp + wait_from(watch_cancel).await; + } else { + // Stuff runs + + // When a cancel signal is sent, stuff stops + + // Collect stuff + for (desc, join_handle) in servers { + if let Err(e) = join_handle.await? { + error!("{} server exited with error: {}", desc, e); + } else { + info!("{} server exited without error.", desc); + } } } // Remove RPC handlers for system to break reference cycles + info!("Deregistering RPC handlers for shutdown..."); garage.system.netapp.drop_all_handlers(); opentelemetry::global::shutdown_tracer_provider(); |