Commit f51382a
committed
Kill Windows process tree on subprocess timeout to unblock proc.communicate()
When a subprocess times out on Windows, proc.kill() only kills the direct
child. Grandchild processes (e.g. installer EXEs spawned by winget) inherit
the pipe write handles and keep them open, causing the subsequent
proc.communicate() call to block indefinitely until every grandchild exits.
Fix by calling taskkill /F /T /PID before proc.communicate() to kill the
entire process tree atomically. Also run windows_processes_to_cleanup in the
timeout path, mirroring what already happens in the normal exit path.1 parent 4a98354 commit f51382a
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
830 | 848 | | |
831 | 849 | | |
832 | 850 | | |
| |||
0 commit comments