pyptlib - use JobObjects on windows to automatically kill PT children when PT itself dies
This allows obfs-flash-client to work smoothly on windows. Otherwise, some orphan processes sometimes hang around, using up listen-ports, and prevent the next PT from starting its children.
Patch is here: https://github.com/infinity0/pyptlib/compare/w32-subproc
Note that this is just a temporary measure to get things working on windows, until we implement #10047 (moved).
original ticket contents, obsolete since #comment:7:
Allow tor helpers to use JobObjects by setting CREATE_BREAKAWAY_FROM_JOB (Windows-only)
While building Windows pbfs-flash PTTB bundles, we encountered an issue where the obfsproxy child of obfs-flash would not be terminated properly after closing the PTTBB. More information can be found in comment:5:ticket:10006 .
After lots of digging around, the problem was solved by toggling the
CREATE_BREAKAWAY_FROM_JOB flag of
tor_spawn_background(). More info in comment:26:ticket:10006.
We should look at the possible side-effects of adding the
CREATE_BREAKAWAY_FROM_JOB flag there, and if it's innocuous then we should implement the change and get it merged.