Skip to content

More judicious use of file descriptors #71

Open

Description

@ionelmc

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 😤

Activity

  1. ionelmc commented on Jan 8, 2018

    @ionelmc
    MemberAuthor

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

  2. RonnyPfannschmidt commented on Jan 24, 2023

    @RonnyPfannschmidt
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions