[
https://issues.apache.org/jira/browse/MESOS-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15120490#comment-15120490
]
Joseph Wu commented on MESOS-4536:
----------------------------------
We ran into this requirement for the {{ContainerLogger}} module. Essentially,
the module needs to start a {{Subprocess}} and take sole ownership of any
{{PIPE}}. It would then pass these pipes (along with ownership) to the
containerizer (and subsequently to another {{Subprocess}}), at which point, the
parent process would no longer have the FD open.
Without strict ownership, we run the risk of leaving the FD open, which would
break the {{ContainerLogger}}. In the {{ContainerLogger}}, some FDs won't be
closed until a subprocess terminates, but the subprocess only terminates when
the FD is closed.
> Add abstractions of "owned" and "shared" file descriptors to libprocess.
> ------------------------------------------------------------------------
>
> Key: MESOS-4536
> URL: https://issues.apache.org/jira/browse/MESOS-4536
> Project: Mesos
> Issue Type: Improvement
> Components: libprocess
> Reporter: Joseph Wu
> Assignee: Joseph Wu
>
> Libprocess currently manages file descriptors as plain {{int}} s. This leads
> to some easily missed bugs regarding duplicated or closed FDs.
> We should introduce an abstraction (like {{unique_ptr}} and {{shared_ptr}})
> so that FD ownership can be expressed alongside the affected code.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)