> On April 15, 2019, 10:06 p.m., Benjamin Mahler wrote: > > src/master/validation.cpp > > Lines 1625-1629 (original), 1669-1676 (patched) > > <https://reviews.apache.org/r/70472/diff/1/?file=2139119#file2139119line1669> > > > > Hm.. have we validated prior to here that the resources are valid? e.g. > > if the task or executor on its own specifies overlapping ranges or sets is > > that allowed?
Yep, this code is executed through `validation::task::group::validate()`, which is called in `Master::_accept()`. Before that, in `Master::accept()`, we run `validateAndUpgradeResources()` on the LAUNCH_GROUP operation, which executes `Resources::validate()` on all executor and task resources. So by the time we execute the code highlighted here, we have verified that there are no overlapping ranges, and no sets with duplicate items. - Greg ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/70472/#review214672 ----------------------------------------------------------- On April 13, 2019, 2:04 a.m., Greg Mann wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/70472/ > ----------------------------------------------------------- > > (Updated April 13, 2019, 2:04 a.m.) > > > Review request for mesos, Benno Evers, Benjamin Mahler, Gastón Kleiman, and > Meng Zhu. > > > Bugs: MESOS-9619 > https://issues.apache.org/jira/browse/MESOS-9619 > > > Repository: mesos > > > Description > ------- > > This patch adds validation to the master to ensure that task > groups do not include resources with overlapping set- or > range-valued resources, as this can crash the allocator. > > > Diffs > ----- > > src/master/validation.hpp 71748c121aa3518d68811ea1e60707d195b58657 > src/master/validation.cpp f032a781608857d0c9cfa220dd8d70f74d60f1ec > src/tests/master_tests.cpp 964d935771a99efaee63187affe46b551146f310 > src/tests/master_validation_tests.cpp > 400ad686291e08f578f27cfb9341263972e36684 > > > Diff: https://reviews.apache.org/r/70472/diff/1/ > > > Testing > ------- > > `make check` > `bin/mesos-tests.sh --gtest_filter="*NonoverlappingSetsAndRanges*" > --gtest_repeat=-1 --gtest_break_on_failure` > `bin/mesos-tests.sh > --gtest_filter="*LaunchGroupOverlappingSetAndRangeResources*" > --gtest_repeat=-1 --gtest_break_on_failure` > > > Thanks, > > Greg Mann > >
