Skip to content

Confusion about UseHandle handles being closed. #2

Description

@snoyberg

Sorry for initial empty description...

When working on a library, I was surprised to find that the Handles that I passed in for std_in, std_out and std_err via UseHandle were automatically closed. This is not clear from the documentation, and- at least for the use case I was interested in- the opposite of what I needed. There are valid cases where we'd want the Handle to remain open after the process runs to completion.

The function createProcess_ in the .Internals module has the behavior I was looking for, and for my purpose, I can simply import from there. I'd like to propose two changes:

  1. Add clear documentation to createProcess indicating that it will close the Handle automatically.
  2. Add a new function to be exported from System.Process with the semantics of createProcess_. I'm open to bikeshedding on the name, but perhaps sticking with createProcess_ makes the most sense.

Note that I do not think we should change the existing semantics of createProcess: I think it's a large breaking change, and should be avoided.

I'm happy to provide pull requests for both of these, I just wanted to check if there was objection before going ahead with it.

Activity

  1. snoyberg commented on Sep 22, 2014

    @snoyberg
    CollaboratorAuthor

    Initial description was empty, I've edited the description to contain the desired content.

  2. sol commented on Nov 1, 2014

    @sol
    Member

    I'm looking at the process code right now and was puzzled by the very same thing. While there are probably many situations where you want the handles to be closed, I don't see how this is universally true.

  3. hvr commented on Nov 25, 2014

    @hvr
    Member

    @snoyberg maybe try libraries@ and/or cafe to get more feedback/attention, as I'm afraid otherwise only few ppl will see this ticket...

  4. snoyberg commented on Nov 25, 2014

    @snoyberg
    CollaboratorAuthor

    Good idea @hvr, email sent.

  5. hvr commented on Nov 25, 2014

    @hvr
    Member

    @snoyberg btw, as for the timeline; for this to be part of the process version as shipped w/ GHC 7.10, we'd ideally need a PR ready by mid-december

  6. snoyberg commented on Nov 25, 2014

    @snoyberg
    CollaboratorAuthor

    If there aren't any serious objections to the proposal on the libraries@ list this week, I'll send a pull request on Sunday for this.

  7. hvr commented on Dec 18, 2014

    @hvr
    Member

    so... is this issue resolved now?

  8. snoyberg commented on Dec 18, 2014

    @snoyberg
    CollaboratorAuthor

    Yes, thank you.

  9. added a commit that references this issue on May 4, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions