WebStorm Node.js timeout and Stop button signal delivery limits
0 reputation · 26 Jun 2023, 12:09 UTC
WebStorm run/debug configurations for Node.js include a per-configuration Timeout field and a Stop button, but the exact forced-termination sequence across platforms is not fully documented. On macOS and Linux, the Stop action sends SIGTERM, while Windows uses CTRL_BREAK_EVENT; whether WebStorm escalates to SIGKILL after a grace period, and whether that sequence is configurable, remains unclear.
There is no separate setting for a graceful shutdown timeout distinct from the process timeout, and npm run configurations appear to inherit the same termination behavior without triggering npm lifecycle scripts such as prestop. When designing local workflows for Node.js services that rely on signal handlers to drain connections or flush logs, these limits affect how reliably cleanup code executes.
Because timeout values are per configuration rather than global, each run configuration must be evaluated individually. Is the termination sequence documented for current WebStorm versions, and does it differ by operating system? Does WebStorm expose a configurable grace period for graceful shutdown before forced termination, or must applications rely solely on their own signal handling? Should npm lifecycle scripts be expected to run when a run configuration is stopped or times out, or does forced termination bypass them entirely?