Kills the process and all its descendants. POSIX: SIGTERM to the process group, SIGKILL after FORCE_KILL_TIMEOUT. Windows: immediate Job Object termination (already a hard kill).
(process: ServerProcess)
| 288 | |
| 289 | |
| 290 | async def _terminate_process_tree(process: ServerProcess) -> None: |
| 291 | """Kills the process and all its descendants. |
| 292 | |
| 293 | POSIX: SIGTERM to the process group, SIGKILL after FORCE_KILL_TIMEOUT. |
| 294 | Windows: immediate Job Object termination (already a hard kill). |
| 295 | """ |
| 296 | if sys.platform == "win32": # pragma: no cover |
| 297 | await terminate_windows_process_tree(process) |
| 298 | else: # pragma: lax no cover |
| 299 | # The Windows-only FallbackProcess never reaches the POSIX path. |
| 300 | assert isinstance(process, Process) |
| 301 | await terminate_posix_process_tree(process, FORCE_KILL_TIMEOUT) |
| 302 | |
| 303 | |
| 304 | def _close_subprocess_transport(process: ServerProcess) -> None: |