From bc1e32ca47cf27da9ff7b19b0d574d34f874951f Mon Sep 17 00:00:00 2001 From: George Stagg Date: Wed, 1 Jul 2026 09:02:15 +0100 Subject: [PATCH] Acknowledge SIGINT at top level --- ggsql-jupyter/src/kernel.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/ggsql-jupyter/src/kernel.rs b/ggsql-jupyter/src/kernel.rs index b9844c602..1737d9e6b 100644 --- a/ggsql-jupyter/src/kernel.rs +++ b/ggsql-jupyter/src/kernel.rs @@ -137,17 +137,14 @@ impl KernelServer { } } _ = tokio::signal::ctrl_c() => { - tracing::warn!("Received SIGINT, shutting down gracefully"); - // Send a final idle status before exiting - // Note: We don't have a parent message here, so we'll send without one - let msg = self.create_message( - "status", - json!({"execution_state": "idle"}), - None, - ); - let zmq_msg = self.serialize_message_with_topic(&msg, "status")?; - let _ = self.iopub.send(zmq_msg).await; - break; + // With `interrupt_mode: "signal"`, the frontend sends SIGINT to + // interrupt a running cell, not to stop the kernel. Emit a busy + // -> idle pair to acknowledge the interrupt. + // TODO: When cell execution becomes async, cancel any in-flight + // request here instead. + tracing::debug!("Received SIGINT; acknowledging."); + self.send_status_initial("busy").await?; + self.send_status_initial("idle").await?; } } }