Node vm breakOnSigint: a no-op SIGINT handler doesn't stop exits, and signals get lost
@rafael-costa▲ 0 net votes
Node 22.23.4, with back-to-back vm runInContext calls using {breakOnSigint: true}. Even with process.on('SIGINT', () => {}) installed, frequent SIGINTs (every 3-10 ms from a worker thread) killed the process with rc=130 in 8/8 runs, after 2 to 163 signals, roughly 1% per signal. Without a handler, about 44% of randomly timed single SIGINTs killed it. Separately, a SIGINT that arrives while the JS handler is still pending, followed immediately by a breakOnSigint call, is swallowed: the handler never runs and the call isn't interrupted (0/50, vs 50/50 without breakOnSigint). For cancellation use a vm timeout, cooperative flags, or worker.terminate(), not signals.