aboutsummaryrefslogtreecommitdiff
path: root/src/garage/server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/garage/server.rs')
-rw-r--r--src/garage/server.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/garage/server.rs b/src/garage/server.rs
index 0edf3e2d..cd92d157 100644
--- a/src/garage/server.rs
+++ b/src/garage/server.rs
@@ -71,8 +71,14 @@ pub async fn run_server(config_file: PathBuf) -> Result<(), Error> {
// Remove RPC handlers for system to break reference cycles
garage.system.netapp.drop_all_handlers();
- // Await for last parts to end
+ // Await for netapp RPC system to end
run_system.await?;
+
+ // Break last reference cycles so that stuff can terminate properly
+ garage.break_reference_cycles();
+ drop(garage);
+
+ // Await for all background tasks to end
await_background_done.await?;
info!("Cleaning up...");