From 8d816e4582208802d319071e90ef4e1810960718 Mon Sep 17 00:00:00 2001 From: Martin Weindel Date: Mon, 25 Aug 2014 14:30:51 +0200 Subject: [PATCH 1/2] fix for MESOS-1688 --- src/master/hierarchical_allocator_process.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/master/hierarchical_allocator_process.hpp b/src/master/hierarchical_allocator_process.hpp index 34f8cd65892..318e6710070 100644 --- a/src/master/hierarchical_allocator_process.hpp +++ b/src/master/hierarchical_allocator_process.hpp @@ -823,7 +823,7 @@ HierarchicalAllocatorProcess::allocatable( const Resources& resources) { // TODO(benh): For now, only make offers when there is some cpu - // and memory left. This is an artifact of the original code that + // or memory left. This is an artifact of the original code that // only offered when there was at least 1 cpu "unit" available, // and without doing this a framework might get offered resources // with only memory available (which it obviously will decline) @@ -833,8 +833,8 @@ HierarchicalAllocatorProcess::allocatable( Option cpus = resources.cpus(); Option mem = resources.mem(); - if (cpus.isSome() && mem.isSome()) { - return cpus.get() >= MIN_CPUS && mem.get() > MIN_MEM; + if (cpus.isSome() || mem.isSome()) { + return cpus.get() >= MIN_CPUS || mem.get() > MIN_MEM; } return false; From 5280ff4612cbb386e6ba9474f6422c148e0a73ce Mon Sep 17 00:00:00 2001 From: Martin Weindel Date: Mon, 25 Aug 2014 15:03:23 +0200 Subject: [PATCH 2/2] Fix for MESOS-1688 --- src/master/hierarchical_allocator_process.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/master/hierarchical_allocator_process.hpp b/src/master/hierarchical_allocator_process.hpp index 318e6710070..0ddbc1180c2 100644 --- a/src/master/hierarchical_allocator_process.hpp +++ b/src/master/hierarchical_allocator_process.hpp @@ -833,11 +833,8 @@ HierarchicalAllocatorProcess::allocatable( Option cpus = resources.cpus(); Option mem = resources.mem(); - if (cpus.isSome() || mem.isSome()) { - return cpus.get() >= MIN_CPUS || mem.get() > MIN_MEM; - } - - return false; + return (cpus.isSome() && cpus.get() >= MIN_CPUS) + || (mem.isSome() && mem.get() > MIN_MEM); } } // namespace allocator {