> On April 25, 2018, 3:39 p.m., Jiang Yan Xu wrote:
> > src/master/master.cpp
> > Lines 10577-10584 (patched)
> > <https://reviews.apache.org/r/66644/diff/3/?file=2012148#file2012148line10577>
> >
> >     This is the case we don't need to use `at()` as we are modifying the 
> > hashmap, we are not concerned about adding empty entries. We can just use 
> > `[]`: 
> > http://www.cplusplus.com/reference/unordered_map/unordered_map/operator[]/
> >     
> >     The following should work for all the cases here.
> >     
> >     ```
> >     slaves.unreachableTasks[slave->id].put(task->framework_id(), 
> > task->task_id());
> >     ```
> 
> Megha Sharma wrote:
>     I agree we can just use the `unordered_map::operator[]` without the empty 
> entry adding concern but `unordered_map::at` here has the same behavior. I 
> don't mind changing it but just curious here as to why we prefer the 
> `operator[]` in this case?

Because the 8 lines can be condensed into 1-2? It's not about `[]` vs. `at` per 
se but the whole condition checking. I'd say the `[]` behavior is precesely 
created for this case so we'd better use it. :)


- Jiang Yan


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


On April 25, 2018, 8:46 a.m., Megha Sharma wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66644/
> -----------------------------------------------------------
> 
> (Updated April 25, 2018, 8:46 a.m.)
> 
> 
> Review request for mesos and Jiang Yan Xu.
> 
> 
> Bugs: 8750
>     https://issues.apache.org/jira/browse/8750
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> A RunTask messsage could get dropped for an agent while it's
> disconnected from the master and when such an agent goes unreachable
> then this dropped task gets added to the unreachable tasks.
> When the agent reregisters, tasks reported by it are removed from the 
> unreachableTasks bookkeeping on the master but since the
> agent doesn't know about the dropped task so it doesn't get removed
> from the unreachableTasks leading to a master check failure when
> this inconsistency is detected during framework removal.
> 
> 
> Diffs
> -----
> 
>   src/master/master.hpp 0d9620dd0c232dc1df83477e838eeb7313bf8828 
>   src/master/master.cpp 767ad8cfe142b47ef07172bcb2a4fb49fc3e833a 
>   src/tests/partition_tests.cpp 9138e5c745cf354a3573e1ab0b251d46702833cc 
> 
> 
> Diff: https://reviews.apache.org/r/66644/diff/4/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Megha Sharma
> 
>

Reply via email to