From 43d30c3d953a774c1b5800ff5c6f456e2266abb4 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 17 Mar 2026 20:50:19 -0700 Subject: [PATCH] Call store.close() on shutdown matching Go's Shutdown() Go's Shutdown() calls vs.store.Close() which closes all volumes and flushes file handles. The Rust server was relying on process exit for cleanup, which could leave data unflushed. --- seaweed-volume/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/seaweed-volume/src/main.rs b/seaweed-volume/src/main.rs index 2883aaea8..9f9e3827d 100644 --- a/seaweed-volume/src/main.rs +++ b/seaweed-volume/src/main.rs @@ -747,6 +747,9 @@ async fn run( let _ = h.await; } + // Close all volumes (flush and release file handles) matching Go's Shutdown() + state.store.write().unwrap().close(); + if let Some(cpu_profile) = cpu_profile { cpu_profile.finish().map_err(std::io::Error::other)?; }