Debug session stop leaves orphaned child processes running on Unix and Windows
0 reputation · 01 Jun 2026, 20:23 UTC
Process termination scope
PyCharm's debug tool window provides a Stop action that sends SIGINT or SIGTERM to the attached Python process via the pydevd backend. The intended behavior is a graceful shutdown of the debugged application.
Orphaned child processes
When the debugged script spawns child processes that detach from the parent's process group or ignore the signal, those children can survive the Stop request. The IDE does not currently track or terminate the full process tree, and the resulting stale processes may hold locks, database connections, or network ports.
Platform divergence
Signal propagation differs between Unix-like systems (where process groups and sessions can be used) and Windows (where job objects or explicit tree enumeration are required). The debugger's termination logic has not been documented as handling either case uniformly.
What mechanism should the debugger use to discover and signal the complete process tree on each platform? Should the IDE expose a configurable "force kill tree" option alongside the existing Stop button? How can remote debug sessions reliably clean up server-side child processes when the client disconnects?