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



More detail on the recent fix: the bug arose because I reordered the fields of 
`cluster::Master`. The order in which the fields are declared should match the 
order in which the fields are initialized in `cluster::Master`'s ctor. This is 
because the fields have dependencies on one another (registrar depends on 
`storage`, which depends on `log`, etc.). We shouldn't destruct a field if any 
of the fields that depend on it are still alive.

I fixed this by keeping the field order the same, and adding a comment to 
document this behavior. We might alternatively use explicit `reset` calls in 
the dtor of `cluster::Master`; in that case, the order of the `reset`s should 
be the reverse of the order in which the fields are initialized in the ctor. 
That is also fragile, however.

- Neil Conway


On Sept. 14, 2016, 10:35 a.m., Neil Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51375/
> -----------------------------------------------------------
> 
> (Updated Sept. 14, 2016, 10:35 a.m.)
> 
> 
> Review request for mesos and Vinod Kone.
> 
> 
> Bugs: MESOS-4049
>     https://issues.apache.org/jira/browse/MESOS-4049
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This allows test cases to inspect how the master interacts with
> the registry.
> 
> This commit changes `tests::cluster::Master` to use `MockRegistrar`
> exclusively, even for test cases that aren't interested in mocking
> aspects of the master <-> registrar interaction. However, this should be
> harmless, since by default `MockRegistrar` behaves identically to the
> normal registrar.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am 2dd7913a1477f3c3560be4e2c1450b93fb3afc78 
>   src/master/registrar.hpp c39dd1b5430084e51376143b5441db346e85a153 
>   src/tests/cluster.hpp c6fbbf24e04c38cc9a94ce0c13db445c03e804c7 
>   src/tests/cluster.cpp b04653af97d17aaa9d0d3ee872169b66cd67126b 
>   src/tests/mock_registrar.hpp PRE-CREATION 
>   src/tests/mock_registrar.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/51375/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Neil Conway
> 
>

Reply via email to