Result of a process tree kill operation. Attributes: status: "success" if all processes terminated, "partial" if some required force-kill, "failure" if parent couldn't be killed parent_pid: PID of the parent process children_found: Number of child processes f
| 17 | |
| 18 | @dataclass |
| 19 | class KillResult: |
| 20 | """Result of a process tree kill operation. |
| 21 | |
| 22 | Attributes: |
| 23 | status: "success" if all processes terminated, "partial" if some required |
| 24 | force-kill, "failure" if parent couldn't be killed |
| 25 | parent_pid: PID of the parent process |
| 26 | children_found: Number of child processes found |
| 27 | children_terminated: Number of children that terminated gracefully |
| 28 | children_killed: Number of children that required SIGKILL |
| 29 | parent_forcekilled: Whether the parent required SIGKILL |
| 30 | """ |
| 31 | |
| 32 | status: Literal["success", "partial", "failure"] |
| 33 | parent_pid: int |
| 34 | children_found: int = 0 |
| 35 | children_terminated: int = 0 |
| 36 | children_killed: int = 0 |
| 37 | parent_forcekilled: bool = False |
| 38 | |
| 39 | |
| 40 | def kill_process_tree(proc: subprocess.Popen, timeout: float = 5.0) -> KillResult: |