You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Neil Conway <ne...@gmail.com> on 2016/11/30 19:21:12 UTC

Review Request 54223: Adjusted agent `usedResources` accounting at the master.

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

Review request for mesos and Benjamin Mahler.


Repository: mesos


Description
-------

If an agent finished running all the tasks for a given framework, the
previous coding resulted in leaving an empty `Resources` object in the
Slave's `usedResources` hashmap.

Along the way, replace using `[]` to access a hashmap in a `CHECK` with
`at`. Because `[]` can modify the map, we should generally prefer using
`at` for accesses that are intended to be read-only.


Diffs
-----

  src/master/master.hpp b6c610b79aab146ece6b9be59be86f283d1c9ee8 

Diff: https://reviews.apache.org/r/54223/diff/


Testing
-------

`make check`

By adding `LOG(INFO)` to `Master::finalize()`, I validated that when running a test like `MasterTest.KillTask`, the previous implementation left a key with an empty `Resources` object in the `usedResources` hashmap. After this change, the `hashmap` is empty, as expected.


Thanks,

Neil Conway


Re: Review Request 54223: Adjusted agent `usedResources` accounting at the master.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/54223/#review157470
-----------------------------------------------------------


Ship it!




Ship It!

- Benjamin Mahler


On Nov. 30, 2016, 7:21 p.m., Neil Conway wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54223/
> -----------------------------------------------------------
> 
> (Updated Nov. 30, 2016, 7:21 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> If an agent finished running all the tasks for a given framework, the
> previous coding resulted in leaving an empty `Resources` object in the
> Slave's `usedResources` hashmap.
> 
> Along the way, replace using `[]` to access a hashmap in a `CHECK` with
> `at`. Because `[]` can modify the map, we should generally prefer using
> `at` for accesses that are intended to be read-only.
> 
> 
> Diffs
> -----
> 
>   src/master/master.hpp b6c610b79aab146ece6b9be59be86f283d1c9ee8 
> 
> Diff: https://reviews.apache.org/r/54223/diff/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> By adding `LOG(INFO)` to `Master::finalize()`, I validated that when running a test like `MasterTest.KillTask`, the previous implementation left a key with an empty `Resources` object in the `usedResources` hashmap. After this change, the `hashmap` is empty, as expected.
> 
> 
> Thanks,
> 
> Neil Conway
> 
>