-
-
Notifications
You must be signed in to change notification settings - Fork 373
Open
Description
Hi,
run_process uses trio.to_thread.run_sync to spawn the subprocess; this means that the spawned process will inherit various context from a different thread. In my case this means it spawns in the wrong (network) namespace (see setns(2) - "reassociate thread with a namespace").
This might affect other things as well (pthreads(7) lists (among other things) capabilities and CPU affinity).
- the docs should mention this behavior
- it would be nice to have a flag to "spawn from current thread"
I'm also open to good suggestions how to work around this problem :)
(I might try prefixing the target command with ["/usr/bin/nsenter", "--target", threading.get_native_id(), "-n", "--"], or copy the trio run_process/open_process functions).
cheers,
Stefan
Metadata
Metadata
Assignees
Labels
No labels