[ https://issues.apache.org/jira/browse/MESOS-9804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16865376#comment-16865376 ]
James Peach commented on MESOS-9804: ------------------------------------ This is not to be fixed. The current code doesn't close after the fork, but does mark the inherited descriptors {{CLOEXEC}}. If we close these instead, then it would be harder for subprocess hooks to pass a fd into the child and use it in a child hook, which is a legitimate and useful pattern. If we don't close it, then we have the same semantics as today. So I think that the current code works correctly. > Subprocess should close inherited file descriptors earlier. > ----------------------------------------------------------- > > Key: MESOS-9804 > URL: https://issues.apache.org/jira/browse/MESOS-9804 > Project: Mesos > Issue Type: Improvement > Components: libprocess > Reporter: James Peach > Priority: Major > > The libprocess {{subprocess}} API doesn't close the file descriptors that are > inherited across fork until after applying the child hooks. This means that > the inherited descriptors can remain open for much longer than you expect, > since parent and child hooks both need to be scheduled and run. > We should move the file descriptor closing as early as possible in the child. > We might also consider having the child write a byte back to the parent so > that we have a guaranteed synchronization point. -- This message was sent by Atlassian JIRA (v7.6.3#76005)