You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Benjamin Mahler <bm...@apache.org> on 2017/02/03 00:17:33 UTC
Re: Review Request 55910: Prevent unintended mutation in the
allocator.
> On Jan. 30, 2017, 8:34 p.m., Michael Park wrote:
> > src/master/allocator/mesos/hierarchical.cpp, lines 387-391
> > <https://reviews.apache.org/r/55910/diff/1/?file=1614081#file1614081line387>
> >
> > Not yours, but do you know what's going on here?
> > The comment doesn't seem to match the code.
Hm.. did you interpret 'delete' to mean clear? The 'delete' is deferred until expire.
> On Jan. 30, 2017, 8:34 p.m., Michael Park wrote:
> > src/master/allocator/mesos/hierarchical.cpp, line 1446
> > <https://reviews.apache.org/r/55910/diff/1/?file=1614081#file1614081line1446>
> >
> > Did you mean `const Owned<Sorter>&` here?
> >
> > I'd prefer to not introduce more places where `Owned` is being used like a `Shared`.
> >
> > or maybe even:
> >
> > ```cpp
> > Sorter& frameworkSorter = *frameworkSorters.at(role);
> > ```
Whoops, yes I meant `const Owned<Sorter>&` as done on the other lookups.
- Benjamin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55910/#review163567
-----------------------------------------------------------
On Jan. 25, 2017, 2:40 a.m., Benjamin Mahler wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/55910/
> -----------------------------------------------------------
>
> (Updated Jan. 25, 2017, 2:40 a.m.)
>
>
> Review request for mesos and Michael Park.
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Currently, a lof of code in the allocator makes use of the `[]`
> operator to access the agents, frameworks and sorters, which
> can lead to subtle bugs where insertion was unintended.
>
> With this change, a few const functions can be marked as such.
>
>
> Diffs
> -----
>
> src/master/allocator/mesos/hierarchical.hpp 9b66c23f26b37c02ed850c06c4518ea99078b02d
> src/master/allocator/mesos/hierarchical.cpp c2211be7458755aeb91ef078e4bfe92ac474044a
>
> Diff: https://reviews.apache.org/r/55910/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Benjamin Mahler
>
>