You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Andrew Schwartzmeyer <an...@schwartzmeyer.com> on 2018/02/02 00:17:39 UTC
Review Request 65469: Windows: Made `IO::OWNED` file descriptors
inheritable.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65469/
-----------------------------------------------------------
Review request for mesos, Akash Gupta, Jie Yu, and Joseph Wu.
Repository: mesos
Description
-------
On Windows, we make all file handles non-inheritable by default.
Therefore when creating a `Subprocess::FD` for a subprocess to inherit a
file descriptor, we have to explicitly make it inheritable. This was
already happening as a side-effect of `os::dup` for `IO::DUPLICATED`
file descriptors, but not for `IO::OWNED`. Both, however, are meant to
be inherited.
Diffs
-----
3rdparty/libprocess/src/subprocess.cpp 785e2e1083d115d25fffde2df74ed8bc1726511c
Diff: https://reviews.apache.org/r/65469/diff/1/
Testing
-------
Thanks,
Andrew Schwartzmeyer
Re: Review Request 65469: Windows: Updated
`internal::process:createChildProcess`.
Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65469/#review197110
-----------------------------------------------------------
PASS: Mesos patch 65469 was successfully built and tested.
Reviews applied: `['65399', '65400', '65401', '65402', '65403', '65405', '65406', '65407', '65408', '65409', '65465', '65467', '65574', '65469']`
All the build artifacts available at: http://dcos-win.westus.cloudapp.azure.com/mesos-build/review/65469
- Mesos Reviewbot Windows
On Feb. 8, 2018, 7:50 p.m., Andrew Schwartzmeyer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65469/
> -----------------------------------------------------------
>
> (Updated Feb. 8, 2018, 7:50 p.m.)
>
>
> Review request for mesos, Akash Gupta, Jie Yu, and Joseph Wu.
>
>
> Bugs: MESOS-8512
> https://issues.apache.org/jira/browse/MESOS-8512
>
>
> Repository: mesos
>
>
> Description
> -------
>
> The interface of `internal::windows:create_process` was changed to
> accept a `std::array<os::WindowsFD, 3>` instead of a `std::tuple`.
>
> Furthermore, the error handling in `subprocess` was incorrect. We only
> need to check the success of `createChildProcess`; we do not need to
> check if `pid == -1` on Windows. We also now return the actual error
> from `create_process` if it errored, instead of the whole
> `Try<process_data>`.
>
> The TODO about closing the child-ends of the file descriptors was
> resolved. We now close these in `createChildProcess`, immediately after
> `create_process`. This means we only have to do it once.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/subprocess.cpp 785e2e1083d115d25fffde2df74ed8bc1726511c
> 3rdparty/libprocess/src/subprocess_windows.hpp 0183bb451f68528acf31ed97754320c64f35102b
>
>
> Diff: https://reviews.apache.org/r/65469/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Andrew Schwartzmeyer
>
>
Re: Review Request 65469: Windows: Updated
`internal::process:createChildProcess`.
Posted by Mesos Reviewbot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65469/#review197152
-----------------------------------------------------------
Patch looks great!
Reviews applied: [65397, 65398, 65399, 65400, 65401, 65402, 65405, 65406, 65407, 65408, 65409, 65465, 65403, 65467, 65574, 65469]
Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose --disable-libtool-wrappers' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker-build.sh
- Mesos Reviewbot
On Feb. 8, 2018, 7:50 p.m., Andrew Schwartzmeyer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65469/
> -----------------------------------------------------------
>
> (Updated Feb. 8, 2018, 7:50 p.m.)
>
>
> Review request for mesos, Akash Gupta, Jie Yu, and Joseph Wu.
>
>
> Bugs: MESOS-8512
> https://issues.apache.org/jira/browse/MESOS-8512
>
>
> Repository: mesos
>
>
> Description
> -------
>
> The interface of `internal::windows:create_process` was changed to
> accept a `std::array<os::WindowsFD, 3>` instead of a `std::tuple`.
>
> Furthermore, the error handling in `subprocess` was incorrect. We only
> need to check the success of `createChildProcess`; we do not need to
> check if `pid == -1` on Windows. We also now return the actual error
> from `create_process` if it errored, instead of the whole
> `Try<process_data>`.
>
> The TODO about closing the child-ends of the file descriptors was
> resolved. We now close these in `createChildProcess`, immediately after
> `create_process`. This means we only have to do it once.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/subprocess.cpp 785e2e1083d115d25fffde2df74ed8bc1726511c
> 3rdparty/libprocess/src/subprocess_windows.hpp 0183bb451f68528acf31ed97754320c64f35102b
>
>
> Diff: https://reviews.apache.org/r/65469/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Andrew Schwartzmeyer
>
>
Re: Review Request 65469: Windows: Updated
`internal::process:createChildProcess`.
Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65469/
-----------------------------------------------------------
(Updated Feb. 8, 2018, 11:50 a.m.)
Review request for mesos, Akash Gupta, Jie Yu, and Joseph Wu.
Changes
-------
Pretty much a new commit.
Summary (updated)
-----------------
Windows: Updated `internal::process:createChildProcess`.
Bugs: MESOS-8512
https://issues.apache.org/jira/browse/MESOS-8512
Repository: mesos
Description (updated)
-------
The interface of `internal::windows:create_process` was changed to
accept a `std::array<os::WindowsFD, 3>` instead of a `std::tuple`.
Furthermore, the error handling in `subprocess` was incorrect. We only
need to check the success of `createChildProcess`; we do not need to
check if `pid == -1` on Windows. We also now return the actual error
from `create_process` if it errored, instead of the whole
`Try<process_data>`.
The TODO about closing the child-ends of the file descriptors was
resolved. We now close these in `createChildProcess`, immediately after
`create_process`. This means we only have to do it once.
Diffs (updated)
-----
3rdparty/libprocess/src/subprocess.cpp 785e2e1083d115d25fffde2df74ed8bc1726511c
3rdparty/libprocess/src/subprocess_windows.hpp 0183bb451f68528acf31ed97754320c64f35102b
Diff: https://reviews.apache.org/r/65469/diff/2/
Changes: https://reviews.apache.org/r/65469/diff/1-2/
Testing
-------
Thanks,
Andrew Schwartzmeyer
Re: Review Request 65469: Windows: Made `IO::OWNED` file descriptors
inheritable.
Posted by Akash Gupta <ak...@hotmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65469/#review197045
-----------------------------------------------------------
3rdparty/libprocess/src/subprocess.cpp
Lines 259 (patched)
<https://reviews.apache.org/r/65469/#comment277146>
Actually, should we enable inheritance in `internal::windows::create_process` and then immediately disable it after the proccess finshes initializing? That way, we keep the handle inheritable as little as possible to avoid leaks. I think `create_process` is the only case where you actually need inheritable handles.
- Akash Gupta
On Feb. 2, 2018, 8:12 p.m., Andrew Schwartzmeyer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65469/
> -----------------------------------------------------------
>
> (Updated Feb. 2, 2018, 8:12 p.m.)
>
>
> Review request for mesos, Akash Gupta, Jie Yu, and Joseph Wu.
>
>
> Bugs: MESOS-8512
> https://issues.apache.org/jira/browse/MESOS-8512
>
>
> Repository: mesos
>
>
> Description
> -------
>
> On Windows, we make all file handles non-inheritable by default.
> Therefore when creating a `Subprocess::FD` for a subprocess to inherit a
> file descriptor, we have to explicitly make it inheritable. This was
> already happening as a side-effect of `os::dup` for `IO::DUPLICATED`
> file descriptors, but not for `IO::OWNED`. Both, however, are meant to
> be inherited.
>
>
> Diffs
> -----
>
> 3rdparty/libprocess/src/subprocess.cpp 785e2e1083d115d25fffde2df74ed8bc1726511c
>
>
> Diff: https://reviews.apache.org/r/65469/diff/1/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Andrew Schwartzmeyer
>
>
Re: Review Request 65469: Windows: Made `IO::OWNED` file descriptors
inheritable.
Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65469/
-----------------------------------------------------------
(Updated Feb. 2, 2018, 12:12 p.m.)
Review request for mesos, Akash Gupta, Jie Yu, and Joseph Wu.
Bugs: MESOS-8512
https://issues.apache.org/jira/browse/MESOS-8512
Repository: mesos
Description
-------
On Windows, we make all file handles non-inheritable by default.
Therefore when creating a `Subprocess::FD` for a subprocess to inherit a
file descriptor, we have to explicitly make it inheritable. This was
already happening as a side-effect of `os::dup` for `IO::DUPLICATED`
file descriptors, but not for `IO::OWNED`. Both, however, are meant to
be inherited.
Diffs
-----
3rdparty/libprocess/src/subprocess.cpp 785e2e1083d115d25fffde2df74ed8bc1726511c
Diff: https://reviews.apache.org/r/65469/diff/1/
Testing
-------
Thanks,
Andrew Schwartzmeyer