From 3304504604433d81cea1160dfecfc44d4594b683 Mon Sep 17 00:00:00 2001 From: Nachiket Roy Date: Fri, 31 Jul 2026 18:38:55 +0530 Subject: [PATCH] fix(firecracker): intercept SIGTERM and SIGINT to terminate VMM process immediately Firecracker does not handle SIGTERM/SIGINT, causing the signals to be ignored and leaving the VMM process running. When containerd/kubelet sends SIGTERM during container stop, the process stays alive for the entire 30-second grace period until containerd finally escalates to SIGKILL. We now intercept SIGTERM and SIGINT in Firecracker's Signal method and redirect them to Stop(), which terminates the VMM process immediately. This makes Firecracker container deletion instant (less than a second) rather than blocking for 30 seconds on every stop/delete cycle. Fixes #789 Signed-off-by: Nachiket Roy --- pkg/unikontainers/hypervisors/firecracker.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/unikontainers/hypervisors/firecracker.go b/pkg/unikontainers/hypervisors/firecracker.go index 9588a45bf..51586b469 100644 --- a/pkg/unikontainers/hypervisors/firecracker.go +++ b/pkg/unikontainers/hypervisors/firecracker.go @@ -77,6 +77,9 @@ type FirecrackerConfig struct { } func (fc *Firecracker) Signal(pid int, signal unix.Signal) error { + if signal == unix.SIGTERM || signal == unix.SIGINT { + return fc.Stop(pid) + } return unix.Kill(pid, signal) }