Github user xujyan commented on a diff in the pull request:
https://github.com/apache/mesos/pull/279#discussion_r179542793
--- Diff: src/master/master.cpp ---
@@ -6792,6 +6793,7 @@ void Master::__reregisterSlave(
// master (those tasks were previously marked "unreachable", so they
// should be removed from that collection).
vector<Task> recoveredTasks;
+ hashmap<FrameworkID, hashset<TaskID>> frameworkToTasks =
slaves.unreachableAgentsToTasks[slaveInfo.id()];
--- End diff --
If possible we should avoid copying things out? Are we able to access the
tasks in-place?
Also, use `at` instead of `[]` to access the map when reading it (after
testing the existence of keys by `contains`) to avoid accidentally inserting
empty entries.
It's possible for an agent to not show up in `slaves.unreachableTasks`
because of its GC algorithm right?
---