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



src/tests/mesos.hpp (line 152)
<https://reviews.apache.org/r/41168/#comment171604>

    Then why not return this as Owned? Capturing this requirement as a comment 
is brittle and prone to bugs.
    
    Also, it's clear you've got a global invariant that you're trying to 
comment on here, in particular, that when someone calls `CreateContainerLogger` 
that container logger will get passed into a (some? which?) containerizer which 
will be responsible for cleaning it up! But as a generic `MesosTest` function 
why can I not just call `CreateContainerLogger` at any point and _not_ pass it 
into a containerzer? Then does this comment still apply?
    
    While we could just clean up the comment (i.e., "the caller owns the 
returned pointer and must clean it up"), by returning an `Owned` no comment is 
necessary!
    
    Note that the one place where we make exceptions to this rule is factory 
functions, like `ContainerLogger::create`, but even there I'd love to see a 
world where we use `Owned`.


- Benjamin Hindman


On Dec. 15, 2015, 8:40 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41168/
> -----------------------------------------------------------
> 
> (Updated Dec. 15, 2015, 8:40 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Artem Harutyunyan.
> 
> 
> Bugs: MESOS-4088
>     https://issues.apache.org/jira/browse/MESOS-4088
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a helper that creates and initializes the `ContainerLogger`.  This is 
> used in some tests that use test-only containerizer constructors.
> 
> 
> Diffs
> -----
> 
>   src/tests/mesos.hpp 689efb40dc22337766b624218d2504d5de3e5cd8 
>   src/tests/mesos.cpp a501f04dfbf9c93c2196e83b512519e925a67c97 
> 
> Diff: https://reviews.apache.org/r/41168/diff/
> 
> 
> Testing
> -------
> 
> This will be tested later in the review chain.
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>

Reply via email to