You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Cody Maloney <co...@mesosphere.io> on 2014/10/09 03:20:42 UTC

Review Request 26472: stout: Always use stout ABORT() rather than system abort()

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

Review request for mesos, Adam B and Dominic Hamon.


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


Repository: mesos-git


Description
-------

This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.

Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.


Diffs
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1 
  3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2 
  3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc2 
  3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed 
  3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a7 
  3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b 
  3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef 
  3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f 
  3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8 
  3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c55 

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


Testing
-------

make distcheck


Thanks,

Cody Maloney


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Cody Maloney <co...@mesosphere.io>.

> On Oct. 9, 2014, 3:49 a.m., Dominic Hamon wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp, line 36
> > <https://reviews.apache.org/r/26472/diff/1/?file=716305#file716305line36>
> >
> >     it might be worth considering using stringstream here to build the same error message we had before.
> >     
> >     we will have a stack trace, but having the thing that was attempting to stringify could be useful too, i think.
> 
> Adam B wrote:
>     +1 on "having the thing that was attempting to stringify could be useful"
> 
> Cody Maloney wrote:
>     The thing is we would be doing the same operation which just failed in order to try to print out T again. So in the failure case (Which is unlikely to fail unless you are OOM), we have the operation fail, then try the failed thing again in order to provide debug information.
>     
>     I'm planning to make ABORT() give backtraces on debug builds, which should provide a lot more information than this ever possibly did, without retrying something we know is likely to fail because it just did.
> 
> Dominic Hamon wrote:
>     stringify would fail again, but we used to use ostream operators. We should then be able to use stringstream to get some representation of t.

I can do typeid(t).name() which would give me the mangled name and use libcxxabi (Available on all of our platforms), to demangle it to the human-friendly C++ type name, But that is a lot of utility library to add for little benefit.


- Cody


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


On Oct. 9, 2014, 4:35 p.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2014, 4:35 p.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Dominic Hamon <dh...@twopensource.com>.

> On Oct. 8, 2014, 8:49 p.m., Dominic Hamon wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp, line 36
> > <https://reviews.apache.org/r/26472/diff/1/?file=716305#file716305line36>
> >
> >     it might be worth considering using stringstream here to build the same error message we had before.
> >     
> >     we will have a stack trace, but having the thing that was attempting to stringify could be useful too, i think.
> 
> Adam B wrote:
>     +1 on "having the thing that was attempting to stringify could be useful"
> 
> Cody Maloney wrote:
>     The thing is we would be doing the same operation which just failed in order to try to print out T again. So in the failure case (Which is unlikely to fail unless you are OOM), we have the operation fail, then try the failed thing again in order to provide debug information.
>     
>     I'm planning to make ABORT() give backtraces on debug builds, which should provide a lot more information than this ever possibly did, without retrying something we know is likely to fail because it just did.

stringify would fail again, but we used to use ostream operators. We should then be able to use stringstream to get some representation of t.


- Dominic


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


On Oct. 9, 2014, 9:35 a.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2014, 9:35 a.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Dominic Hamon <dh...@twopensource.com>.

> On Oct. 8, 2014, 8:49 p.m., Dominic Hamon wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp, line 36
> > <https://reviews.apache.org/r/26472/diff/1/?file=716305#file716305line36>
> >
> >     it might be worth considering using stringstream here to build the same error message we had before.
> >     
> >     we will have a stack trace, but having the thing that was attempting to stringify could be useful too, i think.
> 
> Adam B wrote:
>     +1 on "having the thing that was attempting to stringify could be useful"
> 
> Cody Maloney wrote:
>     The thing is we would be doing the same operation which just failed in order to try to print out T again. So in the failure case (Which is unlikely to fail unless you are OOM), we have the operation fail, then try the failed thing again in order to provide debug information.
>     
>     I'm planning to make ABORT() give backtraces on debug builds, which should provide a lot more information than this ever possibly did, without retrying something we know is likely to fail because it just did.
> 
> Dominic Hamon wrote:
>     stringify would fail again, but we used to use ostream operators. We should then be able to use stringstream to get some representation of t.
> 
> Cody Maloney wrote:
>     I can do typeid(t).name() which would give me the mangled name and use libcxxabi (Available on all of our platforms), to demangle it to the human-friendly C++ type name, But that is a lot of utility library to add for little benefit.

std::ostringstream os;
    os << t;
    ABORT("Failed to stringify: " + os.str());
    
is the equivalent of what was there.


- Dominic


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


On Oct. 9, 2014, 9:35 a.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2014, 9:35 a.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Adam B <ad...@mesosphere.io>.

> On Oct. 8, 2014, 8:49 p.m., Dominic Hamon wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp, line 36
> > <https://reviews.apache.org/r/26472/diff/1/?file=716305#file716305line36>
> >
> >     it might be worth considering using stringstream here to build the same error message we had before.
> >     
> >     we will have a stack trace, but having the thing that was attempting to stringify could be useful too, i think.

+1 on "having the thing that was attempting to stringify could be useful"


- Adam


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


On Oct. 8, 2014, 6:20 p.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 8, 2014, 6:20 p.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc2 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a7 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c55 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Cody Maloney <co...@mesosphere.io>.

> On Oct. 9, 2014, 3:49 a.m., Dominic Hamon wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp, line 36
> > <https://reviews.apache.org/r/26472/diff/1/?file=716305#file716305line36>
> >
> >     it might be worth considering using stringstream here to build the same error message we had before.
> >     
> >     we will have a stack trace, but having the thing that was attempting to stringify could be useful too, i think.
> 
> Adam B wrote:
>     +1 on "having the thing that was attempting to stringify could be useful"

The thing is we would be doing the same operation which just failed in order to try to print out T again. So in the failure case (Which is unlikely to fail unless you are OOM), we have the operation fail, then try the failed thing again in order to provide debug information.

I'm planning to make ABORT() give backtraces on debug builds, which should provide a lot more information than this ever possibly did, without retrying something we know is likely to fail because it just did.


- Cody


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


On Oct. 9, 2014, 1:20 a.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2014, 1:20 a.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc2 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a7 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c55 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Cody Maloney <co...@mesosphere.io>.

> On Oct. 9, 2014, 3:49 a.m., Dominic Hamon wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp, line 36
> > <https://reviews.apache.org/r/26472/diff/1/?file=716305#file716305line36>
> >
> >     it might be worth considering using stringstream here to build the same error message we had before.
> >     
> >     we will have a stack trace, but having the thing that was attempting to stringify could be useful too, i think.
> 
> Adam B wrote:
>     +1 on "having the thing that was attempting to stringify could be useful"
> 
> Cody Maloney wrote:
>     The thing is we would be doing the same operation which just failed in order to try to print out T again. So in the failure case (Which is unlikely to fail unless you are OOM), we have the operation fail, then try the failed thing again in order to provide debug information.
>     
>     I'm planning to make ABORT() give backtraces on debug builds, which should provide a lot more information than this ever possibly did, without retrying something we know is likely to fail because it just did.
> 
> Dominic Hamon wrote:
>     stringify would fail again, but we used to use ostream operators. We should then be able to use stringstream to get some representation of t.
> 
> Cody Maloney wrote:
>     I can do typeid(t).name() which would give me the mangled name and use libcxxabi (Available on all of our platforms), to demangle it to the human-friendly C++ type name, But that is a lot of utility library to add for little benefit.
> 
> Dominic Hamon wrote:
>     std::ostringstream os;
>         os << t;
>         ABORT("Failed to stringify: " + os.str());
>         
>     is the equivalent of what was there.

That is what the function does, and what fails though (and causes the message to be printed). The full function would be:
```
template <typename T>
std::string stringify(T t)
{
  std::ostringstream out;
  out << t;
  if (!out.good()) {
    ABORT("Failed to stringify!" + out.str());
  }
  return out.str();
}
```
I could do:
```
template <typename T>
std::string stringify(T t)
{
  std::ostringstream out;
  out << t;
  if (!out.good()) {
    ABORT(std::string("Failed to stringify!") + typeid(T).name());
  }
  return out.str();
}
```
Which would give the info people want probably, although the type name will be mangled per http://mentorembedded.github.io/cxx-abi/abi.html#mangling


- Cody


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


On Oct. 9, 2014, 4:35 p.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2014, 4:35 p.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Dominic Hamon <dh...@twopensource.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26472/#review55946
-----------------------------------------------------------

Ship it!


Ship It!


3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp
<https://reviews.apache.org/r/26472/#comment96311>

    it might be worth considering using stringstream here to build the same error message we had before.
    
    we will have a stack trace, but having the thing that was attempting to stringify could be useful too, i think.


- Dominic Hamon


On Oct. 8, 2014, 6:20 p.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 8, 2014, 6:20 p.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc2 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a7 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c55 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Dominic Hamon <dh...@twopensource.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26472/#review56007
-----------------------------------------------------------

Ship it!


Ship It!

- Dominic Hamon


On Oct. 9, 2014, 9:35 a.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2014, 9:35 a.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Cody Maloney <co...@mesosphere.io>.

> On Oct. 9, 2014, 9:59 p.m., Ben Mahler wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp, lines 442-443
> > <https://reviews.apache.org/r/26472/diff/2/?file=716714#file716714line442>
> >
> >     Hm.. could we avoid the assumption that stringify() keeps errno intact?
> >     
> >     ```
> >     char* error = strerror(errno);
> >     
> >     ABORT("..." + error);
> >     ```

What I would like to do (longer term) is make a couple helpers such as:
```
template <typename T>
Try<T> TryOsReturn(T);

template <typename T>
Try<T> TryOsNonZero(T);
```
That take the os function return and then calls strerror for us when needed to set the error message. Would make it much, much harder to accidentally perturb errno.


> On Oct. 9, 2014, 9:59 p.m., Ben Mahler wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp, lines 42-44
> > <https://reviews.apache.org/r/26472/diff/2/?file=716719#file716719line42>
> >
> >     How about wrapping `strerror` with `std::string()` in these cases so that you don't have to deal with the strange indentation here?
> >     
> >     ```
> >     ABORT("Failed to destruct thread local, pthread_key_delete: " +
> >           std::string(strerror(errno)));
> >     ```

Updated


- Cody


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


On Oct. 10, 2014, 12:44 a.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 10, 2014, 12:44 a.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Ben Mahler <be...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26472/#review56060
-----------------------------------------------------------


Looks good, just two minor issues below.

Deferring to adam and dominic for committing.


3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp
<https://reviews.apache.org/r/26472/#comment96410>

    Hm.. could we avoid the assumption that stringify() keeps errno intact?
    
    ```
    char* error = strerror(errno);
    
    ABORT("..." + error);
    ```



3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp
<https://reviews.apache.org/r/26472/#comment96409>

    There's a bug here ;)



3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp
<https://reviews.apache.org/r/26472/#comment96408>

    How about wrapping `strerror` with `std::string()` in these cases so that you don't have to deal with the strange indentation here?
    
    ```
    ABORT("Failed to destruct thread local, pthread_key_delete: " +
          std::string(strerror(errno)));
    ```


- Ben Mahler


On Oct. 9, 2014, 4:35 p.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2014, 4:35 p.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Adam B <ad...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26472/#review56498
-----------------------------------------------------------

Ship it!


Minor consistency nit, but otherwise quite shippable.


3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp
<https://reviews.apache.org/r/26472/#comment96869>

    Not sure why you didn't "wrap strerror with std::string()" in all these cases.


- Adam B


On Oct. 9, 2014, 5:46 p.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2014, 5:46 p.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Cody Maloney <co...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26472/
-----------------------------------------------------------

(Updated Oct. 10, 2014, 12:46 a.m.)


Review request for mesos, Adam B and Dominic Hamon.


Changes
-------

Fix a bad indent in thread.hpp


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


Repository: mesos-git


Description
-------

This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.

Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
  3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
  3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
  3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
  3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
  3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
  3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
  3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
  3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
  3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 

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


Testing
-------

make distcheck


Thanks,

Cody Maloney


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Cody Maloney <co...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26472/
-----------------------------------------------------------

(Updated Oct. 10, 2014, 12:44 a.m.)


Review request for mesos, Adam B and Dominic Hamon.


Changes
-------

Updated to address Ben Mahler's comments


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


Repository: mesos-git


Description
-------

This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.

Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
  3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
  3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
  3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
  3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
  3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
  3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
  3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
  3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
  3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 

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


Testing
-------

make distcheck


Thanks,

Cody Maloney


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Cody Maloney <co...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26472/
-----------------------------------------------------------

(Updated Oct. 9, 2014, 4:35 p.m.)


Review request for mesos, Adam B and Dominic Hamon.


Changes
-------

Update for Adam and Dominic's comments.

Unshadow 'message' member variable
Align ABORT() messages


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


Repository: mesos-git


Description
-------

This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.

Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1faa488cb3048f6d59bae17123b1b05a33 
  3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2275f7ef84e8c486f2090b67a57ca8c670 
  3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc24912f35bfd04d2341b2218ea349ab40b8 
  3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed10293c3dd7f55b7d30f6014bd05fd7455 
  3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a771c59092cb72d4dac0d868eec7df2f088 
  3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b6468fb36daceba60d8b43bf2fbfceab6c 
  3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef2b617bd87261bf4836706cedb80fdf043 
  3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f517da75525d0dedacaf4a1c6f8cbf55f4 
  3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8391d5213f0d76fa5980176726a0366f56 
  3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c551170b747d25207efe7d3c03675b184953 

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


Testing
-------

make distcheck


Thanks,

Cody Maloney


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Cody Maloney <co...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26472/#review55930
-----------------------------------------------------------



3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp
<https://reviews.apache.org/r/26472/#comment96305>

    This removes attempting to stringify the item a second time to display it in an error message. I can add it back in, but it seems like that would likely just recurse into erros.


- Cody Maloney


On Oct. 9, 2014, 1:20 a.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 9, 2014, 1:20 a.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc2 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a7 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c55 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>


Re: Review Request 26472: stout: Always use stout ABORT() rather than system abort()

Posted by Adam B <ad...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/26472/#review55961
-----------------------------------------------------------

Ship it!


Please fix the shadowed variable and maybe the minor alignment nits.


3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp
<https://reviews.apache.org/r/26472/#comment96318>

    Align with std::string



3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp
<https://reviews.apache.org/r/26472/#comment96315>

    Shadowed 'message' variable? How about a different name for the local string?



3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp
<https://reviews.apache.org/r/26472/#comment96317>

    Would prefer to see the second line aligned with std::string, after the 'ABORT('
    Same for other changes in this file


- Adam B


On Oct. 8, 2014, 6:20 p.m., Cody Maloney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/26472/
> -----------------------------------------------------------
> 
> (Updated Oct. 8, 2014, 6:20 p.m.)
> 
> 
> Review request for mesos, Adam B and Dominic Hamon.
> 
> 
> Bugs: MESOS-1870
>     https://issues.apache.org/jira/browse/MESOS-1870
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> This makes it so any time there is an abort, we get a line number and at least a basic message as to why there was an abort. If you want a clean(er) exit, use <stout/exit>.
> 
> Also adds an overload which takes a standard string and unwraps it to a const char * automatically, since a lot of the time we are building strings to pass them to abort.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/abort.hpp 6b5b5d1 
>   3rdparty/libprocess/3rdparty/stout/include/stout/flags/flags.hpp 9d244b2 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 7138bc2 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os/fork.hpp 8aa21ed 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp ccf80a7 
>   3rdparty/libprocess/3rdparty/stout/include/stout/result.hpp ce8dd9b 
>   3rdparty/libprocess/3rdparty/stout/include/stout/stringify.hpp ed0a1ef 
>   3rdparty/libprocess/3rdparty/stout/include/stout/thread.hpp b1af74f 
>   3rdparty/libprocess/3rdparty/stout/include/stout/try.hpp 87c5fc8 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 9207c55 
> 
> Diff: https://reviews.apache.org/r/26472/diff/
> 
> 
> Testing
> -------
> 
> make distcheck
> 
> 
> Thanks,
> 
> Cody Maloney
> 
>