----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/50732/#review144576 -----------------------------------------------------------
Thanks for the fix! src/common/resources.cpp (lines 1631 - 1637) <https://reviews.apache.org/r/50732/#comment210602> - A shared resource is not necessarily a SCALAR. - Also, while true, understanding that "Resources arithmetic logic doesn't allow Resource_ with positive sharedCount but negative value" requires some nonlocal reasoning. Intead I think this is more intuitive: a "negative" Resource_ either has a negative sharedCount or a negative scalar value". This translates into: ``` bool negative = (resource_.isShared() && resource_.sharedCount.get() < 0) || (resource_.resource.type() == Value::SCALAR && resource_.resource.scalar().value() < 0); ``` - Jiang Yan Xu On Aug. 2, 2016, 6:50 p.m., Anindya Sinha wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/50732/ > ----------------------------------------------------------- > > (Updated Aug. 2, 2016, 6:50 p.m.) > > > Review request for mesos, Benjamin Mahler and Jiang Yan Xu. > > > Bugs: MESOS-5972 > https://issues.apache.org/jira/browse/MESOS-5972 > > > Repository: mesos > > > Description > ------- > > Incase of shared resources, the Resource_ object is removed if the > shared count is <= 0, and for non-shared resources, it is removed > if the scalar value is <= 0. > > > Diffs > ----- > > src/common/resources.cpp 7b52c72534cca55185c1df2257b48cb85c49f65c > src/v1/resources.cpp d27c1a24c8e3de40d47cecac0e4528908a39ba52 > > Diff: https://reviews.apache.org/r/50732/diff/ > > > Testing > ------- > > Tests passed. > > > Thanks, > > Anindya Sinha > >
