mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Wu <jos...@mesosphere.io>
Subject Re: Review Request 53473: Add new param user to logrotate's prepare function.
Date Wed, 16 Nov 2016 01:24:20 GMT


> On Nov. 15, 2016, 6:42 a.m., Sivaram Kannan wrote:
> > src/slave/containerizer/mesos/containerizer.cpp, line 1388
> > <https://reviews.apache.org/r/53473/diff/6/?file=1563497#file1563497line1388>
> >
> >     Passing None() has the agent crashing when we have switch_user=false.
> 
> Sivaram Kannan wrote:
>     That is the reason I thought I would have the current user of the agent set to logger.
> 
> Joseph Wu wrote:
>     The reason the agent/test would fail is because of this line in your fourth diff:
>     https://reviews.apache.org/r/53473/diff/4#7
>     
>     `container->config.user()` has a return type of `string`.  When the value is not
set, calling `container->config.user()` returns the empty string.  You need to manually
convert it to an `Option<string>`.
>     
>     `container->config` is a protobuf defined here: 
>     https://github.com/apache/mesos/blob/1.1.x/include/mesos/slave/containerizer.proto#L112
> 
> Sivaram Kannan wrote:
>     https://reviews.apache.org/r/53473/diff/6/ has an explicit conversion to Option<string>.
When container->config.user() is empty, I tried to set 
>     
>     Option<string> user = None()
>     
>     But the call logger->prepare(..., user), still crashes the agent. Doesn't the
below code more logical than setting the value to None()?
>     
>     Result<std::string> result = os::user();
>     user = result.get();

What's the stack trace for the crash?  (And what are the steps taken to repro?)


- Joseph


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


On Nov. 14, 2016, 1:52 p.m., Sivaram Kannan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/53473/
> -----------------------------------------------------------
> 
> (Updated Nov. 14, 2016, 1:52 p.m.)
> 
> 
> Review request for mesos and Joseph Wu.
> 
> 
> Bugs: MESOS-5856
>     https://issues.apache.org/jira/browse/MESOS-5856
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Add new param user to logrotate's prepare function.
> 
> 
> Diffs
> -----
> 
>   include/mesos/slave/container_logger.hpp 939974736f9eb744c83036e074718d2a1eba8b0a 
>   src/slave/container_loggers/lib_logrotate.hpp 28fdf3bdcc66d473521b377f66ab0b48f6900f58

>   src/slave/container_loggers/lib_logrotate.cpp 53698d339f0f4d2dc916b53239ca0c36bbebcd42

>   src/slave/container_loggers/logrotate.hpp d1db69236f5a9b1dbb3113ad02218a512afdb46b

>   src/slave/container_loggers/sandbox.hpp e0aeb32a9ec83af049af8a10010b819c1d8b25d8 
>   src/slave/container_loggers/sandbox.cpp cc263ebef7e0c3e778fabafa49faa6dd315adc45 
>   src/slave/containerizer/docker.cpp c2ed5240aab9ea9d1a386c44c94e5ae7e98d313c 
>   src/slave/containerizer/mesos/containerizer.cpp ec4ae32485a7ab6c9f73c512004d1220482a188e

>   src/tests/container_logger_tests.cpp 1bb94a8461e481983f25a44737e4011ed5fc4b1f 
> 
> Diff: https://reviews.apache.org/r/53473/diff/
> 
> 
> Testing
> -------
> 
> Run the mesos-logrotate-logger with un-priviledged user and verify whether the logs are
getting rotated.
> Run the mesos-logrotate-logger as root user and verify whether the logs are getting rotated.
> 
> 
> Thanks,
> 
> Sivaram Kannan
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message