----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/63554/#review190564 -----------------------------------------------------------
src/resource_provider/manager.cpp Lines 321 (patched) <https://reviews.apache.org/r/63554/#comment268044> Do a `return Failure(` because `collect` would return a failure anyways. We don't have to send out `PUBLISH` events for subsequent resource providers. You could also do this contains check when filling up the `publishing` hashmap and fail early. src/resource_provider/manager.cpp Lines 336-338 (patched) <https://reviews.apache.org/r/63554/#comment268046> Same as above: We should do a `return Failure(` here. src/resource_provider/manager.cpp Lines 440 (patched) <https://reviews.apache.org/r/63554/#comment268048> The promise needs to be deleted as well. Removing it from `pending` here assumes that a `published` will be called. But `publish` has some failure scenarios where `published` won't be called. E.g. when `resourceProvider->http.send(event)` fails. The promise needs to be removed in these cases as well. src/resource_provider/manager_process.hpp Lines 141 (patched) <https://reviews.apache.org/r/63554/#comment268041> Let's use a `hashmap<UUID, Owned<Promise<Nothing>>>` instead. - Jan Schlicht On Nov. 4, 2017, 2:35 a.m., Chun-Hung Hsiao wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/63554/ > ----------------------------------------------------------- > > (Updated Nov. 4, 2017, 2:35 a.m.) > > > Review request for mesos, Jie Yu, Joseph Wu, and Jan Schlicht. > > > Bugs: MESOS-7550 > https://issues.apache.org/jira/browse/MESOS-7550 > > > Repository: mesos > > > Description > ------- > > The publish function takes a `SlaveID` and a `Resources` structure that > includes all resources allocated by all tasks currently running or ready > to run on the agent. Also added validation tests. > > > Diffs > ----- > > src/resource_provider/manager.hpp 3b70e75c6b6721864ae0ee9c4a593b5035d8388f > src/resource_provider/manager.cpp 11f890156f0fd099f8a97b07cdc458a0726ee78e > src/resource_provider/manager_process.hpp PRE-CREATION > src/tests/resource_provider/mock_manager.hpp PRE-CREATION > src/tests/resource_provider/mock_manager.cpp PRE-CREATION > src/tests/resource_provider_manager_tests.cpp > 4008b1c751d6227b99adef756e95174d7d8a62f2 > src/tests/resource_provider_validation_tests.cpp > bf789a05771b7c25f2fc2a8a5b35d38519e4793b > > > Diff: https://reviews.apache.org/r/63554/diff/1/ > > > Testing > ------- > > make > > > Thanks, > > Chun-Hung Hsiao > >
