From 9db5dc5ed1935e6f9f7292132272cb7c5612054e Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 8 Sep 2026 10:42:14 +0200 Subject: [PATCH] Mark sync as incomplete on SIGINT during thermal cooldown to prevent premature commit --- cmdline/sync.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmdline/sync.c b/cmdline/sync.c index 95c9d17f..6b512e70 100644 --- a/cmdline/sync.c +++ b/cmdline/sync.c @@ -1693,8 +1693,16 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari /* drop until now */ state_usage_waste(state); - if (os_signal_interrupt()) + if (os_signal_interrupt()) { + /* + * Mark the sync as incomplete on interruption during cooldown. + * Partial progress is flushed and durable (*sync_durable = 1), but + * completed-sync operations (state_commit() and snapshot promotion) + * must not be executed. + */ + alert = 1; break; + } } /* autosave */