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

2016-04-07 Thread haosdent huang

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




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();
}
```



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


Because abort here, should we use `ERROR` level?


- haosdent huang


On April 7, 2016, 4:55 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated April 7, 2016, 4:55 p.m.)
> 
> 
> Review request for mesos and Joris Van Remoortere.
> 
> 
> 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/ssl/gtest.hpp 
> 5435ddda1fd7dfcff1a0b28f2abe35feb707ceeb 
>   3rdparty/libprocess/include/process/subprocess.hpp 
> 8a3fe5526f480187441a8aee2c72636bec3e2b2d 
>   3rdparty/libprocess/src/subprocess.cpp 
> bb0fcbcd0dfa455c8700247c5b4ca0473fd163c3 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 727e940f12643974de4ff2734fba431b285b5de3 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45495/.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



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

2016-04-07 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?

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?


- Joerg


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


On April 7, 2016, 4:55 p.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated April 7, 2016, 4:55 p.m.)
> 
> 
> Review request for mesos and Joris Van Remoortere.
> 
> 
> 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/ssl/gtest.hpp 
> 5435ddda1fd7dfcff1a0b28f2abe35feb707ceeb 
>   3rdparty/libprocess/include/process/subprocess.hpp 
> 8a3fe5526f480187441a8aee2c72636bec3e2b2d 
>   3rdparty/libprocess/src/subprocess.cpp 
> bb0fcbcd0dfa455c8700247c5b4ca0473fd163c3 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 727e940f12643974de4ff2734fba431b285b5de3 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45495/.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



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

2016-04-07 Thread Joerg Schad

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

(Updated April 7, 2016, 4:55 p.m.)


Review request for mesos and Joris Van Remoortere.


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/ssl/gtest.hpp 
5435ddda1fd7dfcff1a0b28f2abe35feb707ceeb 
  3rdparty/libprocess/include/process/subprocess.hpp 
8a3fe5526f480187441a8aee2c72636bec3e2b2d 
  3rdparty/libprocess/src/subprocess.cpp 
bb0fcbcd0dfa455c8700247c5b4ca0473fd163c3 
  3rdparty/libprocess/src/tests/subprocess_tests.cpp 
727e940f12643974de4ff2734fba431b285b5de3 

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


Testing
---

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


Thanks,

Joerg Schad



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

2016-04-05 Thread Joris Van Remoortere

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




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


Please don't include random fixes in reviews. It makes the review / history 
confusing.



3rdparty/libprocess/include/process/subprocess.hpp (lines 178 - 216)


Why the inconsistency between a call operator and a friendship?



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


backticks around `ChildHook`



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


Do we use this `operator() ()` style elsewhere?



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


Why do we need to friend if we've provided a call operator?



3rdparty/libprocess/include/process/subprocess.hpp 


why did you get rid of this whitespace?



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


2 new lines between function definitions



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


Taking the working directory by reference is extremely dangerous here. Why 
do it? Does the style guide default of `[=]` not work?



3rdparty/libprocess/src/subprocess.cpp (lines 63 - 64)


I don't understand how this comment applies to the `chdir` hook?



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


2 new lines between function definitions


- Joris Van Remoortere


On March 31, 2016, 10:21 a.m., Joerg Schad wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45491/
> ---
> 
> (Updated March 31, 2016, 10:21 a.m.)
> 
> 
> Review request for mesos and Joris Van Remoortere.
> 
> 
> 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/ssl/gtest.hpp 
> 5435ddda1fd7dfcff1a0b28f2abe35feb707ceeb 
>   3rdparty/libprocess/include/process/subprocess.hpp 
> 8a3fe5526f480187441a8aee2c72636bec3e2b2d 
>   3rdparty/libprocess/src/subprocess.cpp 
> bb0fcbcd0dfa455c8700247c5b4ca0473fd163c3 
>   3rdparty/libprocess/src/tests/subprocess_tests.cpp 
> 727e940f12643974de4ff2734fba431b285b5de3 
> 
> Diff: https://reviews.apache.org/r/45491/diff/
> 
> 
> Testing
> ---
> 
> Tested entire chain see https://reviews.apache.org/r/45495/.
> 
> 
> Thanks,
> 
> Joerg Schad
> 
>



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

2016-03-31 Thread Joerg Schad

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

(Updated March 31, 2016, 10:21 a.m.)


Review request for mesos and Joris Van Remoortere.


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/ssl/gtest.hpp 
5435ddda1fd7dfcff1a0b28f2abe35feb707ceeb 
  3rdparty/libprocess/include/process/subprocess.hpp 
8a3fe5526f480187441a8aee2c72636bec3e2b2d 
  3rdparty/libprocess/src/subprocess.cpp 
bb0fcbcd0dfa455c8700247c5b4ca0473fd163c3 
  3rdparty/libprocess/src/tests/subprocess_tests.cpp 
727e940f12643974de4ff2734fba431b285b5de3 

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


Testing
---

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


Thanks,

Joerg Schad