You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Akash Gupta <ak...@hotmail.com> on 2018/02/28 18:12:20 UTC
Review Request 65841: Changed `os::system` to return `Option`
instead of `int`.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65841/
-----------------------------------------------------------
Review request for mesos, Andrew Schwartzmeyer, Joseph Wu, and Michael Park.
Bugs: MESOS-4549
https://issues.apache.org/jira/browse/MESOS-4549
Repository: mesos
Description
-------
`os::system` returned -1 on error, which is a valid error code on
Windows, e.g., `os::system("exit -1")`, so it was impossible to
distinguish a failure from a process returning -1. With `Option<int>`,
failures will return as `None`..
Diffs
-----
3rdparty/stout/include/stout/os/posix/shell.hpp b878718e137e4c8b599e0f4dac67672d8df27f7d
3rdparty/stout/include/stout/os/windows/shell.hpp 1696d084c8453fa0eb9ef41e0a4128e547f7f53c
3rdparty/stout/tests/os/rmdir_tests.cpp 2fd24a825068019423674f74fb71cc61d3c504b5
3rdparty/stout/tests/os_tests.cpp d04c3b95b24a519eb21ff07fa51da7c2cefe2b61
src/slave/containerizer/mesos/launch.cpp 75b7eaf9cd62d6b5f02896175168b651f4517e12
src/tests/containerizer/cgroups_isolator_tests.cpp 59b23be78efb4025bfef53a19ab97d9873ab8dc9
src/tests/containerizer/memory_pressure_tests.cpp 0c3e738ce05553a2ee5c38c6748d6d28a1eb93d3
src/tests/environment.cpp 1cba274e0e684b123ce1e4d9cd296f428022fcdc
Diff: https://reviews.apache.org/r/65841/diff/1/
Testing
-------
Thanks,
Akash Gupta
Re: Review Request 65841: Changed `os::system` to return `Option`
instead of `int`.
Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.
> On Feb. 28, 2018, 4:32 p.m., Andrew Schwartzmeyer wrote:
> > Before I review this, it needs to be split for stout and mesos changes.
(Otherwise I'll leave a bunch of comments on code that'll get deleted from this review ;)
- Andrew
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65841/#review198422
-----------------------------------------------------------
On Feb. 28, 2018, 10:12 a.m., Akash Gupta wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65841/
> -----------------------------------------------------------
>
> (Updated Feb. 28, 2018, 10:12 a.m.)
>
>
> Review request for mesos, Andrew Schwartzmeyer, Joseph Wu, and Michael Park.
>
>
> Bugs: MESOS-4549
> https://issues.apache.org/jira/browse/MESOS-4549
>
>
> Repository: mesos
>
>
> Description
> -------
>
> `os::system` returned -1 on error, which is a valid error code on
> Windows, e.g., `os::system("exit -1")`, so it was impossible to
> distinguish a failure from a process returning -1. With `Option<int>`,
> failures will return as `None`..
>
>
> Diffs
> -----
>
> 3rdparty/stout/include/stout/os/posix/shell.hpp b878718e137e4c8b599e0f4dac67672d8df27f7d
> 3rdparty/stout/include/stout/os/windows/shell.hpp 1696d084c8453fa0eb9ef41e0a4128e547f7f53c
> 3rdparty/stout/tests/os/rmdir_tests.cpp 2fd24a825068019423674f74fb71cc61d3c504b5
> 3rdparty/stout/tests/os_tests.cpp d04c3b95b24a519eb21ff07fa51da7c2cefe2b61
> src/slave/containerizer/mesos/launch.cpp 75b7eaf9cd62d6b5f02896175168b651f4517e12
> src/tests/containerizer/cgroups_isolator_tests.cpp 59b23be78efb4025bfef53a19ab97d9873ab8dc9
> src/tests/containerizer/memory_pressure_tests.cpp 0c3e738ce05553a2ee5c38c6748d6d28a1eb93d3
> src/tests/environment.cpp 1cba274e0e684b123ce1e4d9cd296f428022fcdc
>
>
> Diff: https://reviews.apache.org/r/65841/diff/1/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Akash Gupta
>
>
Re: Review Request 65841: Changed `os::system` to return `Option`
instead of `int`.
Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65841/#review198422
-----------------------------------------------------------
Before I review this, it needs to be split for stout and mesos changes.
- Andrew Schwartzmeyer
On Feb. 28, 2018, 10:12 a.m., Akash Gupta wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65841/
> -----------------------------------------------------------
>
> (Updated Feb. 28, 2018, 10:12 a.m.)
>
>
> Review request for mesos, Andrew Schwartzmeyer, Joseph Wu, and Michael Park.
>
>
> Bugs: MESOS-4549
> https://issues.apache.org/jira/browse/MESOS-4549
>
>
> Repository: mesos
>
>
> Description
> -------
>
> `os::system` returned -1 on error, which is a valid error code on
> Windows, e.g., `os::system("exit -1")`, so it was impossible to
> distinguish a failure from a process returning -1. With `Option<int>`,
> failures will return as `None`..
>
>
> Diffs
> -----
>
> 3rdparty/stout/include/stout/os/posix/shell.hpp b878718e137e4c8b599e0f4dac67672d8df27f7d
> 3rdparty/stout/include/stout/os/windows/shell.hpp 1696d084c8453fa0eb9ef41e0a4128e547f7f53c
> 3rdparty/stout/tests/os/rmdir_tests.cpp 2fd24a825068019423674f74fb71cc61d3c504b5
> 3rdparty/stout/tests/os_tests.cpp d04c3b95b24a519eb21ff07fa51da7c2cefe2b61
> src/slave/containerizer/mesos/launch.cpp 75b7eaf9cd62d6b5f02896175168b651f4517e12
> src/tests/containerizer/cgroups_isolator_tests.cpp 59b23be78efb4025bfef53a19ab97d9873ab8dc9
> src/tests/containerizer/memory_pressure_tests.cpp 0c3e738ce05553a2ee5c38c6748d6d28a1eb93d3
> src/tests/environment.cpp 1cba274e0e684b123ce1e4d9cd296f428022fcdc
>
>
> Diff: https://reviews.apache.org/r/65841/diff/1/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Akash Gupta
>
>
Re: Review Request 65841: Stout: Changed `os::system` to return
`Option` instead of `int`.
Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65841/#review198440
-----------------------------------------------------------
FAIL: Some of the unit tests failed. Please check the relevant logs.
Reviews applied: `['65839', '65840', '65841']`
Failed command: `Start-MesosCITesting`
All the build artifacts available at: http://dcos-win.westus.cloudapp.azure.com/mesos-build/review/65841
Relevant logs:
- [libprocess-tests-cmake-stdout.log](http://dcos-win.westus.cloudapp.azure.com/mesos-build/review/65841/logs/libprocess-tests-cmake-stdout.log):
```
"D:\DCOS\mesos\3rdparty\libprocess\src\tests\libprocess-tests.vcxproj" (default target) (1) ->
"D:\DCOS\mesos\3rdparty\libprocess\src\process.vcxproj" (default target) (10) ->
(ClCompile target) ->
D:\DCOS\mesos\mesos\3rdparty\libprocess\src\jwt.cpp(144): warning C4244: 'initializing': conversion from 'double' to 'int64_t', possible loss of data [D:\DCOS\mesos\3rdparty\libprocess\src\process.vcxproj]
D:\DCOS\mesos\mesos\3rdparty\libprocess\src\jwt.cpp(144): warning C4244: 'initializing': conversion from 'double' to 'const int64_t', possible loss of data [D:\DCOS\mesos\3rdparty\libprocess\src\process.vcxproj]
D:\DCOS\mesos\mesos\3rdparty\libprocess\src\ssl\utilities.cpp(360): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [D:\DCOS\mesos\3rdparty\libprocess\src\process.vcxproj]
D:\DCOS\mesos\mesos\3rdparty\libprocess\src\libevent_ssl_socket.cpp(601): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data [D:\DCOS\mesos\3rdparty\libprocess\src\process.vcxproj]
"D:\DCOS\mesos\3rdparty\libprocess\src\tests\libprocess-tests.vcxproj" (default target) (1) ->
"D:\DCOS\mesos\3rdparty\libprocess\src\tests\ssl-client.vcxproj" (default target) (18) ->
(ClCompile target) ->
D:\DCOS\mesos\mesos\3rdparty\libprocess\include\process/gtest.hpp(731): error C3861: 'AssertSignaled': identifier not found [D:\DCOS\mesos\3rdparty\libprocess\src\tests\ssl-client.vcxproj]
D:\DCOS\mesos\mesos\3rdparty\libprocess\include\process/gtest.hpp(770): error C3861: 'AssertTermSigEq': identifier not found [D:\DCOS\mesos\3rdparty\libprocess\src\tests\ssl-client.vcxproj]
D:\DCOS\mesos\mesos\3rdparty\libprocess\include\process/gtest.hpp(817): error C3861: 'AssertTermSigNe': identifier not found [D:\DCOS\mesos\3rdparty\libprocess\src\tests\ssl-client.vcxproj]
"D:\DCOS\mesos\3rdparty\libprocess\src\tests\libprocess-tests.vcxproj" (default target) (1) ->
"D:\DCOS\mesos\3rdparty\libprocess\src\tests\benchmarks.vcxproj" (default target) (7) ->
D:\DCOS\mesos\mesos\3rdparty\libprocess\include\process/gtest.hpp(731): error C3861: 'AssertSignaled': identifier not found (compiling source file D:\DCOS\mesos\mesos\3rdparty\libprocess\src\tests\benchmarks.cpp) [D:\DCOS\mesos\3rdparty\libprocess\src\tests\benchmarks.vcxproj]
D:\DCOS\mesos\mesos\3rdparty\libprocess\include\process/gtest.hpp(770): error C3861: 'AssertTermSigEq': identifier not found (compiling source file D:\DCOS\mesos\mesos\3rdparty\libprocess\src\tests\benchmarks.cpp) [D:\DCOS\mesos\3rdparty\libprocess\src\tests\benchmarks.vcxproj]
D:\DCOS\mesos\mesos\3rdparty\libprocess\include\process/gtest.hpp(817): error C3861: 'AssertTermSigNe': identifier not found (compiling source file D:\DCOS\mesos\mesos\3rdparty\libprocess\src\tests\benchmarks.cpp) [D:\DCOS\mesos\3rdparty\libprocess\src\tests\benchmarks.vcxproj]
23 Warning(s)
6 Error(s)
Time Elapsed 00:06:02.26
```
- [mesos-tests-cmake-stdout.log](http://dcos-win.westus.cloudapp.azure.com/mesos-build/review/65841/logs/mesos-tests-cmake-stdout.log):
```
D:\DCOS\mesos\mesos\src\java\jni\convert.cpp(392): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\java\jni\convert.cpp(414): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\java\jni\convert.cpp(415): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\java\jni\convert.cpp(437): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\java\jni\convert.cpp(438): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\java\jni\convert.cpp(460): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\java\jni\convert.cpp(461): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\java\jni\convert.cpp(500): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\java\jni\convert.cpp(501): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\java\jni\org_apache_mesos_state_Variable.cpp(44): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\java\jni\org_apache_mesos_state_Variable.cpp(45): warning C4267: 'argument': conversion from 'size_t' to 'jsize', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\jvm\jvm.cpp(95): warning C4267: '=': conversion from 'size_t' to 'jint', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\jvm\jvm.cpp(463): warning C4244: 'initializing': conversion from 'jchar' to 'char', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\jvm\jvm.cpp(493): warning C4244: 'initializing': conversion from 'jlong' to 'long', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\jvm\jvm.cpp(654): warning C4244: 'initializing': conversion from 'jchar' to 'char', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\jvm\jvm.cpp(693): warning C4244: 'initializing': conversion from 'jlong' to 'long', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\jvm\jvm.cpp(770): warning C4244: 'initializing': conversion from 'jchar' to 'char', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
D:\DCOS\mesos\mesos\src\jvm\jvm.cpp(809): warning C4244: 'initializing': conversion from 'jlong' to 'long', possible loss of data [D:\DCOS\mesos\src\java\mesos-java.vcxproj]
"D:\DCOS\mesos\src\tests\mesos-tests.vcxproj" (default target) (1) ->
"D:\DCOS\mesos\src\mesos.vcxproj" (default target) (16) ->
(ClCompile target) ->
D:\DCOS\mesos\mesos\src\checks\checker_process.cpp(831): error C3861: 'WTERMSIG': identifier not found [D:\DCOS\mesos\src\mesos.vcxproj]
212 Warning(s)
1 Error(s)
Time Elapsed 00:11:38.90
```
- Mesos Reviewbot Windows
On Feb. 28, 2018, 6:12 p.m., Akash Gupta wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65841/
> -----------------------------------------------------------
>
> (Updated Feb. 28, 2018, 6:12 p.m.)
>
>
> Review request for mesos, Andrew Schwartzmeyer, Joseph Wu, and Michael Park.
>
>
> Bugs: MESOS-4549
> https://issues.apache.org/jira/browse/MESOS-4549
>
>
> Repository: mesos
>
>
> Description
> -------
>
> `os::system` returned -1 on error, which is a valid error code on
> Windows, e.g., `os::system("exit -1")`, so it was impossible to
> distinguish a failure from a process returning -1. With `Option<int>`,
> failures will return as `None`.
>
>
> Diffs
> -----
>
> 3rdparty/stout/include/stout/os/posix/shell.hpp b878718e137e4c8b599e0f4dac67672d8df27f7d
> 3rdparty/stout/include/stout/os/windows/shell.hpp 1696d084c8453fa0eb9ef41e0a4128e547f7f53c
> 3rdparty/stout/tests/os/rmdir_tests.cpp 2fd24a825068019423674f74fb71cc61d3c504b5
> 3rdparty/stout/tests/os_tests.cpp d04c3b95b24a519eb21ff07fa51da7c2cefe2b61
>
>
> Diff: https://reviews.apache.org/r/65841/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Akash Gupta
>
>
Re: Review Request 65841: Stout: Changed `os::system` to return
`Option` instead of `int`.
Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65841/#review198733
-----------------------------------------------------------
Ship it!
3rdparty/stout/include/stout/os/posix/shell.hpp
Lines 119-130 (original), 121-133 (patched)
<https://reviews.apache.org/r/65841/#comment278964>
It looks to me, too, that `Option<int>` is still async signal safe, so it can be used as an analog for `Try<int>`.
- Andrew Schwartzmeyer
On Feb. 28, 2018, 10:12 a.m., Akash Gupta wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65841/
> -----------------------------------------------------------
>
> (Updated Feb. 28, 2018, 10:12 a.m.)
>
>
> Review request for mesos, Andrew Schwartzmeyer, Joseph Wu, and Michael Park.
>
>
> Bugs: MESOS-4549
> https://issues.apache.org/jira/browse/MESOS-4549
>
>
> Repository: mesos
>
>
> Description
> -------
>
> `os::system` returned -1 on error, which is a valid error code on
> Windows, e.g., `os::system("exit -1")`, so it was impossible to
> distinguish a failure from a process returning -1. With `Option<int>`,
> failures will return as `None`.
>
>
> Diffs
> -----
>
> 3rdparty/stout/include/stout/os/posix/shell.hpp b878718e137e4c8b599e0f4dac67672d8df27f7d
> 3rdparty/stout/include/stout/os/windows/shell.hpp 1696d084c8453fa0eb9ef41e0a4128e547f7f53c
> 3rdparty/stout/tests/os/rmdir_tests.cpp 2fd24a825068019423674f74fb71cc61d3c504b5
> 3rdparty/stout/tests/os_tests.cpp d04c3b95b24a519eb21ff07fa51da7c2cefe2b61
>
>
> Diff: https://reviews.apache.org/r/65841/diff/2/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Akash Gupta
>
>