Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More judicious use of file descriptors #71

Open
ionelmc opened this issue Jan 8, 2018 · 2 comments
Open

More judicious use of file descriptors #71

ionelmc opened this issue Jan 8, 2018 · 2 comments
Labels

Comments

@ionelmc
Copy link
Member

ionelmc commented Jan 8, 2018

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 😤

@ionelmc
Copy link
Member Author

ionelmc commented Jan 8, 2018

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

@RonnyPfannschmidt
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants