mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Conway <neil.con...@gmail.com>
Subject Re: Review Request 58305: Add some parameter validation to ReRegisterSlaveMessage.
Date Mon, 17 Apr 2017 19:59:19 GMT

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




src/master/master.cpp
Lines 5570 (patched)
<https://reviews.apache.org/r/58305/#comment245192>

    Can you add a unit test for the end-to-end behavior here? i.e., ensure that if a master
receives a `ReregisterSlaveMessage` with invalid data, it drops the message rather than allowing
the slave to re-register?
    
    You could also potentially add more fine-grained unit tests for the exact validation behavior
(i.e., unit tests for `validation::master::message::reregisterSlave`, not the end-to-end behavior),
up to you.



src/master/validation.cpp
Lines 244 (patched)
<https://reviews.apache.org/r/58305/#comment245188>

    I'd prefer introducing a nested `error` variable inside each of the scopes below.



src/master/validation.cpp
Lines 246 (patched)
<https://reviews.apache.org/r/58305/#comment245213>

    `const Resource& ...`



src/master/validation.cpp
Lines 253 (patched)
<https://reviews.apache.org/r/58305/#comment245212>

    `const FrameworkInfo& ...` please.



src/master/validation.cpp
Lines 259 (patched)
<https://reviews.apache.org/r/58305/#comment245216>

    Personally, I'd find it more readable to say:
    
    ```
    if (frameworkIDs.contains(framework.id()) {
      return Error(...);
    }
    
    frameworkIDs.insert(framework.id());
    ```



src/master/validation.cpp
Lines 261 (patched)
<https://reviews.apache.org/r/58305/#comment245191>

    Include the framework ID in the error message?



src/master/validation.cpp
Lines 265 (patched)
<https://reviews.apache.org/r/58305/#comment245211>

    `const ExecutorInfo& ...` is preferred here.



src/master/validation.cpp
Lines 284 (patched)
<https://reviews.apache.org/r/58305/#comment245190>

    Include the executor ID in the error message?



src/master/validation.cpp
Lines 289 (patched)
<https://reviews.apache.org/r/58305/#comment245214>

    `const Task& ...`



src/master/validation.cpp
Lines 296 (patched)
<https://reviews.apache.org/r/58305/#comment245189>

    Include the slave ID in the error message?



src/master/validation.cpp
Lines 931 (patched)
<https://reviews.apache.org/r/58305/#comment245217>

    Seems unfortunate to explicitly initialize this to `None()` and then re-assign it two
lines below. Personally I'd just prefer initializing it to the result of `executor::validate(...)`.


- Neil Conway


On April 17, 2017, 4:14 p.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58305/
> -----------------------------------------------------------
> 
> (Updated April 17, 2017, 4:14 p.m.)
> 
> 
> Review request for mesos, Mesos Reviewbot and Neil Conway.
> 
> 
> Bugs: MESOS-7372.
>     https://issues.apache.org/jira/browse/MESOS-7372.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The ReRegisterSlaveMessage message sends a number of fields which have
> internal consistency requirements. Add some simple validation checks
> to ensure that we have a minimally consistent re-registration request
> before proceeding.
> 
> 
> Diffs
> -----
> 
>   src/master/master.cpp 0f4c64c6b102ef201779a331c96b5d78a98281ad 
>   src/master/validation.hpp d96287de73ddb30ae2ed841c1b910b0ac6cfa74e 
>   src/master/validation.cpp 3f70875484bbd856ac79a7d6070ac313d69782fa 
> 
> 
> Diff: https://reviews.apache.org/r/58305/diff/4/
> 
> 
> Testing
> -------
> 
> Make check (Fedora 25). Internal fuzzing.
> 
> 
> Thanks,
> 
> James Peach
> 
>


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