You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Andrew Schwartzmeyer (JIRA)" <ji...@apache.org> on 2018/05/16 20:41:00 UTC

[jira] [Created] (MESOS-8926) Fix potential race condition in handle inheritance

Andrew Schwartzmeyer created MESOS-8926:
-------------------------------------------

             Summary: Fix potential race condition in handle inheritance
                 Key: MESOS-8926
                 URL: https://issues.apache.org/jira/browse/MESOS-8926
             Project: Mesos
          Issue Type: Bug
            Reporter: Andrew Schwartzmeyer
            Assignee: Radhika Jandhyala


In our {{CreateProcess}} wrapper {{create_process}} in {{shell.hpp}} we make handles that are supposed to be inherited [temporarily inheritable|https://github.com/apache/mesos/blob/40b40d9b73221388e583fc140280f1eb2b48b832/3rdparty/stout/include/stout/os/windows/shell.hpp#L280], spawn the child process, and then make them uninheritable again. While this works for our purposes, there is a potential race condition where two processes are spawned at the same time and so inherit each others' handles. Technically we could put a lock around this code, but that is unnecessary, as according to this [MSDN blog article|https://blogs.msdn.microsoft.com/oldnewthing/20111216-00/?p=8873] we can instead whitelist those handles when calling {{CreateProcess}}. Note: the existing logic to make them inheritable and then uninheritable again must still exist; we're just adding a whitelist.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)