[ARVADOS] updated: 2d244defaaa4f5f663a5ac11cf507d7203f704e3

git at public.curoverse.com git at public.curoverse.com
Tue Oct 28 13:32:11 EDT 2014


Summary of changes:
 services/nodemanager/arvnodeman/jobqueue.py | 2 +-
 services/nodemanager/tests/test_jobqueue.py | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

       via  2d244defaaa4f5f663a5ac11cf507d7203f704e3 (commit)
      from  846ac5d419862e2b0051ec0843e71c601b35da44 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 2d244defaaa4f5f663a5ac11cf507d7203f704e3
Author: Brett Smith <brett at curoverse.com>
Date:   Tue Oct 28 13:32:05 2014 -0400

    Fix off-by-one error in Node Manager server calculations.
    
    This bug prevented Node Manager from starting nodes for a job that
    requested a number of nodes equal to the daemon's max_nodes setting.
    No issue #.

diff --git a/services/nodemanager/arvnodeman/jobqueue.py b/services/nodemanager/arvnodeman/jobqueue.py
index 0eb5b79..59659fe 100644
--- a/services/nodemanager/arvnodeman/jobqueue.py
+++ b/services/nodemanager/arvnodeman/jobqueue.py
@@ -75,7 +75,7 @@ class ServerCalculator(object):
                 if job['uuid'] not in self.logged_jobs:
                     self.logged_jobs.add(job['uuid'])
                     self.logger.debug("job %s not satisfiable", job['uuid'])
-            elif (want_count < self.max_nodes):
+            elif (want_count <= self.max_nodes):
                 servers.extend([cloud_size.real] * max(1, want_count))
         self.logged_jobs.intersection_update(seen_jobs)
         return servers
diff --git a/services/nodemanager/tests/test_jobqueue.py b/services/nodemanager/tests/test_jobqueue.py
index 0a4d136..158a3fd 100644
--- a/services/nodemanager/tests/test_jobqueue.py
+++ b/services/nodemanager/tests/test_jobqueue.py
@@ -48,6 +48,11 @@ class ServerCalculatorTestCase(unittest.TestCase):
                                   {'min_scratch_mb_per_node': 200})
         self.assertEqual(6, len(servlist))
 
+    def test_job_requesting_max_nodes_accepted(self):
+        servcalc = self.make_calculator([1], max_nodes=4)
+        servlist = self.calculate(servcalc, {'min_nodes': 4})
+        self.assertEqual(4, len(servlist))
+
 
 class JobQueueMonitorActorTestCase(testutil.RemotePollLoopActorTestMixin,
                                    unittest.TestCase):

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list