> On Feb. 8, 2018, 12:03 p.m., Vinod Kone wrote: > > src/master/master.cpp > > Lines 5185-5186 (patched) > > <https://reviews.apache.org/r/65504/diff/1/?file=1952699#file1952699line5203> > > > > this doesn't seem correct? > > > > shouldn't this be > > > > ``` > > CHECK(_offeredResources.contains(taskResources)) > > << _offeredResources << " does not contain " << taskResources; > > > > _offeredResources -= taskResources; > > > > ``` > > > > also, you need to do another check for executor resources before the > > `foreach` loop > > > > ``` > > CHECK(_offeredResources.contains(executorResources)) > > << _offeredResources << " does not contain " << executorResources; > > > > _offeredResources -= executorResources; > > > > ```
The check is outside of the for loop. `totalResources` is incremented in the loop and we are subtracting it all at once outside of the loop. - Meng ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/65504/#review197099 ----------------------------------------------------------- On Feb. 4, 2018, 6:49 p.m., Meng Zhu wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/65504/ > ----------------------------------------------------------- > > (Updated Feb. 4, 2018, 6:49 p.m.) > > > Review request for mesos, Benjamin Mahler, Chun-Hung Hsiao, and Vinod Kone. > > > Bugs: MESOS-1720 > https://issues.apache.org/jira/browse/MESOS-1720 > > > Repository: mesos > > > Description > ------- > > By setting a new field `launch_executor` in the RunTask(Group)Message, > the master is able to control the executor creation on the agent. > > Also refactored `addTask()` logic. Added two new functions: > `isTaskLaunchExecutor()` checks if a task needs to launch executor; > `addExecutor()` adds executor to the framework and slave. > > > Diffs > ----- > > src/master/master.hpp b434d2398b8815811345b6586ca586d2025cb2a2 > src/master/master.cpp d7d22866f7a4eb87bd8949efafc97e828e7d4b94 > > > Diff: https://reviews.apache.org/r/65504/diff/2/ > > > Testing > ------- > > make check > > > Thanks, > > Meng Zhu > >
