You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Joseph Wu <jo...@mesosphere.io> on 2015/12/29 23:18:09 UTC

Review Request 41779: Extend Subprocess::IO::FD with the option to not duplicate the given FD.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41779/
-----------------------------------------------------------

Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Bugs: MESOS-4136
    https://issues.apache.org/jira/browse/MESOS-4136


Repository: mesos


Description
-------

If a subprocess is started with a FD, and the parent process does not need the FD afterwards, the FD does not need to be duplicated.


Diffs
-----

  3rdparty/libprocess/include/process/subprocess.hpp 8704cd0a8af92b848eb9ff7cffe8e5251c5dcfec 
  3rdparty/libprocess/src/subprocess.cpp 863523404b9ef1d2024c108f3e9e1c77c3916049 

Diff: https://reviews.apache.org/r/41779/diff/


Testing
-------

Tests are run in the next review.


Thanks,

Joseph Wu


Re: Review Request 41779: Extend Subprocess::IO::FD with the option to not duplicate the given FD

Posted by Joseph Wu <jo...@mesosphere.io>.

> On Jan. 14, 2016, 7:35 a.m., Bernd Mathiske wrote:
> > 3rdparty/libprocess/include/process/subprocess.hpp, line 126
> > <https://reviews.apache.org/r/41779/diff/2/?file=1196227#file1196227line126>
> >
> >     I would suggest an enum {DUPLICATE, NO_DUPLICATE} instead of a bool. Then code readers do not have to look up the method definition at call sites to understand what "false" might mean. Nor do you have to put a comment at every call site explaining "false".

That sounds good.  I added the enums `DUPLICATE` and `CLOEXEC`.  I think `CLOEXEC` more closely describes the behavior here.  (See in-code comment.)


- Joseph


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41779/#review114484
-----------------------------------------------------------


On Jan. 14, 2016, 11:41 a.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41779/
> -----------------------------------------------------------
> 
> (Updated Jan. 14, 2016, 11:41 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Extend Subprocess::IO::FD with the option to not duplicate the given FD
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/subprocess.hpp 8704cd0a8af92b848eb9ff7cffe8e5251c5dcfec 
>   3rdparty/libprocess/src/subprocess.cpp 863523404b9ef1d2024c108f3e9e1c77c3916049 
> 
> Diff: https://reviews.apache.org/r/41779/diff/
> 
> 
> Testing
> -------
> 
> Tests are run in the next review.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41779: Extended Subprocess::FD to optionally not duplicate the given FD.

Posted by Bernd Mathiske <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41779/#review114484
-----------------------------------------------------------



3rdparty/libprocess/include/process/subprocess.hpp (line 126)
<https://reviews.apache.org/r/41779/#comment175337>

    I would suggest an enum {DUPLICATE, NO_DUPLICATE} instead of a bool. Then code readers do not have to look up the method definition at call sites to understand what "false" might mean. Nor do you have to put a comment at every call site explaining "false".


- Bernd Mathiske


On Jan. 13, 2016, 6:12 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41779/
> -----------------------------------------------------------
> 
> (Updated Jan. 13, 2016, 6:12 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> If a subprocess is started with a FD, and the parent process does not need the FD afterwards, the FD does not need to be duplicated.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/subprocess.hpp 8704cd0a8af92b848eb9ff7cffe8e5251c5dcfec 
>   3rdparty/libprocess/src/subprocess.cpp 863523404b9ef1d2024c108f3e9e1c77c3916049 
> 
> Diff: https://reviews.apache.org/r/41779/diff/
> 
> 
> Testing
> -------
> 
> Tests are run in the next review.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41779: Extend Subprocess::IO::FD with the option to not duplicate the given FD

Posted by Bernd Mathiske <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41779/#review115184
-----------------------------------------------------------

Ship it!


Ship It!

- Bernd Mathiske


On Jan. 14, 2016, 11:41 a.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41779/
> -----------------------------------------------------------
> 
> (Updated Jan. 14, 2016, 11:41 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Extend Subprocess::IO::FD with the option to not duplicate the given FD
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/subprocess.hpp 8704cd0a8af92b848eb9ff7cffe8e5251c5dcfec 
>   3rdparty/libprocess/src/subprocess.cpp 863523404b9ef1d2024c108f3e9e1c77c3916049 
> 
> Diff: https://reviews.apache.org/r/41779/diff/
> 
> 
> Testing
> -------
> 
> Tests are run in the next review.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41779: Extended Subprocess::FD to optionally not duplicate the given FD.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41779/
-----------------------------------------------------------

(Updated Jan. 19, 2016, 7:41 p.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Renamed FD::CLOEXEC to FD::OWNED.


Summary (updated)
-----------------

Extended Subprocess::FD to optionally not duplicate the given FD.


Bugs: MESOS-4136
    https://issues.apache.org/jira/browse/MESOS-4136


Repository: mesos


Description (updated)
-------

This new option is useful when a subprocess is started with a FD, and the parent process does not need the FD afterwards.  In this case, the FD does not need to be duplicated before being sent to the child process.


Diffs (updated)
-----

  3rdparty/libprocess/include/process/subprocess.hpp 8704cd0a8af92b848eb9ff7cffe8e5251c5dcfec 
  3rdparty/libprocess/src/subprocess.cpp 863523404b9ef1d2024c108f3e9e1c77c3916049 

Diff: https://reviews.apache.org/r/41779/diff/


Testing
-------

Tests are run in the next review.


Thanks,

Joseph Wu


Re: Review Request 41779: Extend Subprocess::IO::FD with the option to not duplicate the given FD

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41779/
-----------------------------------------------------------

(Updated Jan. 14, 2016, 11:41 a.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Change the new argument from bool to enum.


Summary (updated)
-----------------

Extend Subprocess::IO::FD with the option to not duplicate the given FD


Bugs: MESOS-4136
    https://issues.apache.org/jira/browse/MESOS-4136


Repository: mesos


Description (updated)
-------

Extend Subprocess::IO::FD with the option to not duplicate the given FD


Diffs (updated)
-----

  3rdparty/libprocess/include/process/subprocess.hpp 8704cd0a8af92b848eb9ff7cffe8e5251c5dcfec 
  3rdparty/libprocess/src/subprocess.cpp 863523404b9ef1d2024c108f3e9e1c77c3916049 

Diff: https://reviews.apache.org/r/41779/diff/


Testing
-------

Tests are run in the next review.


Thanks,

Joseph Wu


Re: Review Request 41779: Extended Subprocess::FD to optionally not duplicate the given FD.

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41779/#review114405
-----------------------------------------------------------

Ship it!


Ship It!

- Benjamin Hindman


On Jan. 14, 2016, 2:12 a.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41779/
> -----------------------------------------------------------
> 
> (Updated Jan. 14, 2016, 2:12 a.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4136
>     https://issues.apache.org/jira/browse/MESOS-4136
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> If a subprocess is started with a FD, and the parent process does not need the FD afterwards, the FD does not need to be duplicated.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/subprocess.hpp 8704cd0a8af92b848eb9ff7cffe8e5251c5dcfec 
>   3rdparty/libprocess/src/subprocess.cpp 863523404b9ef1d2024c108f3e9e1c77c3916049 
> 
> Diff: https://reviews.apache.org/r/41779/diff/
> 
> 
> Testing
> -------
> 
> Tests are run in the next review.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 41779: Extended Subprocess::FD to optionally not duplicate the given FD.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41779/
-----------------------------------------------------------

(Updated Jan. 13, 2016, 6:12 p.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Rebased on a patch that refactors `Subprocess::IO`.


Summary (updated)
-----------------

Extended Subprocess::FD to optionally not duplicate the given FD.


Bugs: MESOS-4136
    https://issues.apache.org/jira/browse/MESOS-4136


Repository: mesos


Description
-------

If a subprocess is started with a FD, and the parent process does not need the FD afterwards, the FD does not need to be duplicated.


Diffs (updated)
-----

  3rdparty/libprocess/include/process/subprocess.hpp 8704cd0a8af92b848eb9ff7cffe8e5251c5dcfec 
  3rdparty/libprocess/src/subprocess.cpp 863523404b9ef1d2024c108f3e9e1c77c3916049 

Diff: https://reviews.apache.org/r/41779/diff/


Testing
-------

Tests are run in the next review.


Thanks,

Joseph Wu


Re: Review Request 41779: Extended Subprocess::IO::FD to optionally not duplicate the given FD.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41779/
-----------------------------------------------------------

(Updated Jan. 5, 2016, 9:32 a.m.)


Review request for mesos, Benjamin Hindman and Artem Harutyunyan.


Changes
-------

Shorten summary.


Summary (updated)
-----------------

Extended Subprocess::IO::FD to optionally not duplicate the given FD.


Bugs: MESOS-4136
    https://issues.apache.org/jira/browse/MESOS-4136


Repository: mesos


Description
-------

If a subprocess is started with a FD, and the parent process does not need the FD afterwards, the FD does not need to be duplicated.


Diffs
-----

  3rdparty/libprocess/include/process/subprocess.hpp 8704cd0a8af92b848eb9ff7cffe8e5251c5dcfec 
  3rdparty/libprocess/src/subprocess.cpp 863523404b9ef1d2024c108f3e9e1c77c3916049 

Diff: https://reviews.apache.org/r/41779/diff/


Testing
-------

Tests are run in the next review.


Thanks,

Joseph Wu