execnet icon indicating copy to clipboard operation
execnet copied to clipboard

More judicious use of file descriptors

Open ionelmc opened this issue 8 years ago • 2 comments

Currently execnet uses pipes without the CLOEXEC flag. There should be something like this around the parts that make the pipes:

old = fcntl.fcntl(fd, fcntl.F_GETFD)
fcntl.fcntl(fd, fcntl.F_SETFD, old | getattr(fcntl, 'FD_CLOEXEC', 1))

Sorry for incredibly-lousy-without-testcase bug report, I'm just at the end of my wits after figuring out my app is littered with subprocess.Popen without close_fds=True :triumph:

ionelmc avatar Jan 08 '18 16:01 ionelmc

Actually execnet just uses subprocess.Popen for workers, perhaps setting the CLOEXEC on stdin/out/err in the workers would be good enough?

ionelmc avatar Jan 08 '18 16:01 ionelmc

@ionelmc are there any more details on this, im about to change bootstrapping to be more "safe"

RonnyPfannschmidt avatar Jan 24 '23 08:01 RonnyPfannschmidt