Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-21 Thread Jie Yu

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


Ship it!




Ship It!

- Jie Yu


On Sept. 21, 2016, 3:25 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 21, 2016, 3:25 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 1e9a7b9051bb986dbda2a5ad408230a1bf6585f2 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> 23bc14a30d013e47c4b48782a90523cd0bbb8c14 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-21 Thread Joerg Schad


> On April 5, 2016, 6:40 p.m., Joris Van Remoortere wrote:
> > 3rdparty/libprocess/include/process/subprocess.hpp, line 219
> > 
> >
> > Do we use this `operator() ()` style elsewhere?
> 
> Joerg Schad wrote:
> If you mean `operator()()` (vs `operator() ()`) then it is fixed.
> Or were you refering to the pattern using `operator()()` in order to 
> expose private functions?

There are some (not to many occurences) of using operator()(). I would drop 
this for now (especially as it doesn't effect the way the hooks are specified, 
so can be changed with little effort).


- Joerg


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


On Sept. 21, 2016, 3:25 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 21, 2016, 3:25 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 1e9a7b9051bb986dbda2a5ad408230a1bf6585f2 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> 23bc14a30d013e47c4b48782a90523cd0bbb8c14 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-21 Thread Joerg Schad


> On April 7, 2016, 6:25 p.m., haosdent huang wrote:
> > 3rdparty/libprocess/src/subprocess.cpp, line 67
> > 
> >
> > I think we could use `os::chdir` here?
> > 
> > ```
> > inline Try chdir(const std::string& directory)
> > {
> >   if (::chdir(directory.c_str()) < 0) {
> > return ErrnoError();
> >   }
> > 
> >   return Nothing();
> > }
> > ```

I currently don't see any advantage here, as we are already in low level code, 
and I want to avoid as may dependencies as possible due to the async safe 
restriction on the child hooks. Is it ok to drop (otherwise please reopen)?


- Joerg


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


On Sept. 21, 2016, 3:25 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 21, 2016, 3:25 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 1e9a7b9051bb986dbda2a5ad408230a1bf6585f2 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> 23bc14a30d013e47c4b48782a90523cd0bbb8c14 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-21 Thread Joerg Schad


> On Sept. 19, 2016, 2:26 a.m., Jie Yu wrote:
> > 3rdparty/libprocess/include/process/subprocess_base.hpp, line 156
> > 
> >
> > I think WATCHDOG is a child hook as well. Can you remove that and 
> > introduce a SUPERVISED child hook?

See https://reviews.apache.org/r/52120/


> On Sept. 19, 2016, 2:26 a.m., Jie Yu wrote:
> > 3rdparty/libprocess/include/process/subprocess_base.hpp, lines 152-155
> > 
> >
> > Looks like these three are only available on posix. Can we make sure to 
> > at least add a TODO and ticket to track to not expose these options on 
> > windows platforms?

Added comment in review 52017.


- Joerg


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


On Sept. 21, 2016, 3:25 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 21, 2016, 3:25 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 1e9a7b9051bb986dbda2a5ad408230a1bf6585f2 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> 23bc14a30d013e47c4b48782a90523cd0bbb8c14 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-21 Thread Joerg Schad

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

(Updated Sept. 21, 2016, 3:25 p.m.)


Review request for mesos, Alexander Rukletsov and Jie Yu.


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


Repository: mesos


Description
---

Previously the subprocess interface supported a several options for the
child process such as setsid. In order to make the interface more
flexible we refactored such options into a vector of ChildHooks.
In order not to allow arbitrary code inside a ChildHook it has to be
constructed via pre-defined factory methods.


Diffs (updated)
-

  3rdparty/libprocess/include/process/posix/subprocess.hpp 
1e9a7b9051bb986dbda2a5ad408230a1bf6585f2 
  3rdparty/libprocess/include/process/ssl/gtest.hpp 
2ad623a5ea3b3286983e895010af756f14f51b64 
  3rdparty/libprocess/include/process/subprocess_base.hpp 
23bc14a30d013e47c4b48782a90523cd0bbb8c14 
  3rdparty/libprocess/src/subprocess.cpp 
8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
  3rdparty/libprocess/src/tests/subprocess_tests.cpp 
0ff3945d2c722ebc1529265427397c5dfba6854e 

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


Testing
---

Tested entire chain see https://reviews.apache.org/r/45492.


Thanks,

Joerg Schad



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-18 Thread Jie Yu

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




3rdparty/libprocess/include/process/subprocess_base.hpp (lines 144 - 147)


Looks like these three are only available on posix. Can we make sure to at 
least add a TODO and ticket to track to not expose these options on windows 
platforms?



3rdparty/libprocess/include/process/subprocess_base.hpp (line 148)


I think WATCHDOG is a child hook as well. Can you remove that and introduce 
a SUPERVISED child hook?


- Jie Yu


On Sept. 18, 2016, 7:43 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 18, 2016, 7:43 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> acd23c99162f164c02a7781abeb95b3c220ead12 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-18 Thread Joerg Schad


> On Sept. 17, 2016, 4:11 a.m., Jie Yu wrote:
> > 3rdparty/libprocess/include/process/subprocess_base.hpp, lines 402-403
> > 
> >
> > Hum, i don't like ChildHook::None(). Have you tried if ```const 
> > vector& child_hooks = {}``` works or not?
> 
> Joerg Schad wrote:
> This is currently consistent with Hook::None(). Do you have a strong 
> opinion?
> 
> Jie Yu wrote:
> Yeah, I'd like to cleanup Hook::None() as well. This caused some 
> confusion to me before. You can clean up the Hook::None() in a separate patch.

https://reviews.apache.org/r/52015/
https://reviews.apache.org/r/52016/


> On Sept. 17, 2016, 4:11 a.m., Jie Yu wrote:
> > 3rdparty/libprocess/include/process/subprocess_base.hpp, line 314
> > 
> >
> > I suggest we rename Hook to ParentHook. You can do that in a separate 
> > patch.
> 
> Joerg Schad wrote:
> Sound good. Will be done in a seperate patch.

https://reviews.apache.org/r/52017/
https://reviews.apache.org/r/52018/


- Joerg


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


On Sept. 18, 2016, 7:43 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 18, 2016, 7:43 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> acd23c99162f164c02a7781abeb95b3c220ead12 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-18 Thread Joerg Schad

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

(Updated Sept. 18, 2016, 7:43 p.m.)


Review request for mesos, Alexander Rukletsov and Jie Yu.


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


Repository: mesos


Description
---

Previously the subprocess interface supported a several options for the
child process such as setsid. In order to make the interface more
flexible we refactored such options into a vector of ChildHooks.
In order not to allow arbitrary code inside a ChildHook it has to be
constructed via pre-defined factory methods.


Diffs (updated)
-

  3rdparty/libprocess/include/process/posix/subprocess.hpp 
57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
  3rdparty/libprocess/include/process/ssl/gtest.hpp 
2ad623a5ea3b3286983e895010af756f14f51b64 
  3rdparty/libprocess/include/process/subprocess_base.hpp 
acd23c99162f164c02a7781abeb95b3c220ead12 
  3rdparty/libprocess/src/subprocess.cpp 
8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
  3rdparty/libprocess/src/tests/subprocess_tests.cpp 
0ff3945d2c722ebc1529265427397c5dfba6854e 

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


Testing
---

Tested entire chain see https://reviews.apache.org/r/45492.


Thanks,

Joerg Schad



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-17 Thread Jie Yu


> On Sept. 17, 2016, 4:11 a.m., Jie Yu wrote:
> > 3rdparty/libprocess/include/process/subprocess_base.hpp, lines 402-403
> > 
> >
> > Hum, i don't like ChildHook::None(). Have you tried if ```const 
> > vector& child_hooks = {}``` works or not?
> 
> Joerg Schad wrote:
> This is currently consistent with Hook::None(). Do you have a strong 
> opinion?

Yeah, I'd like to cleanup Hook::None() as well. This caused some confusion to 
me before. You can clean up the Hook::None() in a separate patch.


- Jie


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


On Sept. 11, 2016, 8:17 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 11, 2016, 8:17 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> acd23c99162f164c02a7781abeb95b3c220ead12 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-17 Thread Joerg Schad


> On Sept. 17, 2016, 4:11 a.m., Jie Yu wrote:
> > 3rdparty/libprocess/include/process/subprocess_base.hpp, line 314
> > 
> >
> > I suggest we rename Hook to ParentHook. You can do that in a separate 
> > patch.

Sound good. Will be done in a seperate patch.


- Joerg


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


On Sept. 11, 2016, 8:17 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 11, 2016, 8:17 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> acd23c99162f164c02a7781abeb95b3c220ead12 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-17 Thread Joerg Schad


> On Sept. 17, 2016, 4:11 a.m., Jie Yu wrote:
> > 3rdparty/libprocess/include/process/subprocess_base.hpp, lines 402-403
> > 
> >
> > Hum, i don't like ChildHook::None(). Have you tried if ```const 
> > vector& child_hooks = {}``` works or not?

This is currently consistent with Hook::None(). Do you have a strong opinion?


- Joerg


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


On Sept. 11, 2016, 8:17 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 11, 2016, 8:17 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> acd23c99162f164c02a7781abeb95b3c220ead12 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-17 Thread Qian Zhang

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




3rdparty/libprocess/include/process/posix/subprocess.hpp (line 214)


s/std::vector/vector/



3rdparty/libprocess/include/process/posix/subprocess.hpp (line 312)


Ditto.



3rdparty/libprocess/src/subprocess.cpp (line 132)


Ditto.


- Qian Zhang


On Sept. 12, 2016, 4:17 a.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 12, 2016, 4:17 a.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> acd23c99162f164c02a7781abeb95b3c220ead12 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-16 Thread Jie Yu

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




3rdparty/libprocess/include/process/posix/subprocess.hpp (lines 282 - 283)


This is in child context. All functions should be async signal safe. 
LOG(WARNING) should not be used.



3rdparty/libprocess/include/process/subprocess_base.hpp (lines 192 - 193)


Fix the indentation?



3rdparty/libprocess/include/process/subprocess_base.hpp (line 305)


I suggest we rename Hook to ParentHook. You can do that in a separate patch.



3rdparty/libprocess/include/process/subprocess_base.hpp (lines 390 - 391)


Hum, i don't like ChildHook::None(). Have you tried if ```const 
vector& child_hooks = {}``` works or not?


- Jie Yu


On Sept. 11, 2016, 8:17 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 11, 2016, 8:17 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> acd23c99162f164c02a7781abeb95b3c220ead12 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-16 Thread Qian Zhang

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




3rdparty/libprocess/include/process/subprocess_base.hpp (line 79)


Not yours, a space was missed here: `descriptor,in`



3rdparty/libprocess/include/process/subprocess_base.hpp (line 94)


s/write/writes/



3rdparty/libprocess/include/process/subprocess_base.hpp (line 99)


Ditto.



3rdparty/libprocess/include/process/subprocess_base.hpp (line 182)


s/start/starts/



3rdparty/libprocess/src/subprocess.cpp (line 55)


Need one more new line.



3rdparty/libprocess/src/subprocess.cpp (lines 65 - 66)


This is the child hook for changing dir, so I think this comment is not 
correct.



3rdparty/libprocess/src/subprocess.cpp (line 81)


s/setdid/setsid/


- Qian Zhang


On Sept. 12, 2016, 4:17 a.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated Sept. 12, 2016, 4:17 a.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov and Jie Yu.
> 
> 
> Bugs: MESOS-5070
> https://issues.apache.org/jira/browse/MESOS-5070
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Previously the subprocess interface supported a several options for the
> child process such as setsid. In order to make the interface more
> flexible we refactored such options into a vector of ChildHooks.
> In order not to allow arbitrary code inside a ChildHook it has to be
> constructed via pre-defined factory methods.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/include/process/posix/subprocess.hpp 
> 57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
>   3rdparty/libprocess/include/process/ssl/gtest.hpp 
> 2ad623a5ea3b3286983e895010af756f14f51b64 
>   3rdparty/libprocess/include/process/subprocess_base.hpp 
> acd23c99162f164c02a7781abeb95b3c220ead12 
>   3rdparty/libprocess/src/subprocess.cpp 
> 8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 0ff3945d2c722ebc1529265427397c5dfba6854e 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45492.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-11 Thread Joerg Schad

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

(Updated Sept. 11, 2016, 8:17 p.m.)


Review request for mesos, Alexander Rukletsov and Jie Yu.


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


Repository: mesos


Description
---

Previously the subprocess interface supported a several options for the
child process such as setsid. In order to make the interface more
flexible we refactored such options into a vector of ChildHooks.
In order not to allow arbitrary code inside a ChildHook it has to be
constructed via pre-defined factory methods.


Diffs
-

  3rdparty/libprocess/include/process/posix/subprocess.hpp 
57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
  3rdparty/libprocess/include/process/ssl/gtest.hpp 
2ad623a5ea3b3286983e895010af756f14f51b64 
  3rdparty/libprocess/include/process/subprocess_base.hpp 
acd23c99162f164c02a7781abeb95b3c220ead12 
  3rdparty/libprocess/src/subprocess.cpp 
8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
  3rdparty/libprocess/src/tests/subprocess_tests.cpp 
0ff3945d2c722ebc1529265427397c5dfba6854e 

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


Testing
---

Tested entire chain see https://reviews.apache.org/r/45492.


Thanks,

Joerg Schad



Re: Review Request 45491: Refactored subprocess options [1/2].

2016-09-11 Thread Joerg Schad

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

(Updated Sept. 11, 2016, 6:51 p.m.)


Review request for mesos, Alexander Rukletsov and Jie Yu.


Summary (updated)
-

Refactored subprocess options [1/2].


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


Repository: mesos


Description
---

Previously the subprocess interface supported a several options for the
child process such as setsid. In order to make the interface more
flexible we refactored such options into a vector of ChildHooks.
In order not to allow arbitrary code inside a ChildHook it has to be
constructed via pre-defined factory methods.


Diffs (updated)
-

  3rdparty/libprocess/include/process/posix/subprocess.hpp 
57f71d15e6fbb032c8b6c5d0c73a93751022e7e7 
  3rdparty/libprocess/include/process/ssl/gtest.hpp 
2ad623a5ea3b3286983e895010af756f14f51b64 
  3rdparty/libprocess/include/process/subprocess_base.hpp 
acd23c99162f164c02a7781abeb95b3c220ead12 
  3rdparty/libprocess/src/subprocess.cpp 
8ca61f77083ac4b77aa1aec22806e1be43dbfa6c 
  3rdparty/libprocess/src/tests/subprocess_tests.cpp 
0ff3945d2c722ebc1529265427397c5dfba6854e 

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


Testing (updated)
---

Tested entire chain see https://reviews.apache.org/r/45492.


Thanks,

Joerg Schad