[ARVADOS] updated: 1.1.4-404-g71db70126

Git user git at public.curoverse.com
Tue Jun 12 13:46:48 EDT 2018


Summary of changes:
 .../arvnodeman/computenode/dispatch/__init__.py           | 10 +++++-----
 services/nodemanager/tests/test_computenode_dispatch.py   | 15 +++++++++------
 2 files changed, 14 insertions(+), 11 deletions(-)

       via  71db701269dc5d2b5eb9239828a74e9c26cd7e66 (commit)
      from  b70f9ce54f1f672b423999e6c07b2f0127b76666 (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 71db701269dc5d2b5eb9239828a74e9c26cd7e66
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Jun 12 14:44:24 2018 -0300

    7478: Moves invalid cloud size node's shutdown decision to proper method.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py b/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py
index dec8ef143..f7bb2cdbd 100644
--- a/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py
+++ b/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py
@@ -370,11 +370,6 @@ class ComputeNodeMonitorActor(config.actor_class):
     def get_state(self):
         """Get node state, one of ['unpaired', 'busy', 'idle', 'down']."""
 
-        # If this node's size is invalid (because it has a stale arvados_node_size
-        # tag), return 'down' so that it's properly shut down.
-        if self.cloud_node.size.id == 'invalid':
-            return 'down'
-
         # If this node is not associated with an Arvados node, return
         # 'unpaired' if we're in the boot grace period, and 'down' if not,
         # so it isn't counted towards usable nodes.
@@ -437,6 +432,11 @@ class ComputeNodeMonitorActor(config.actor_class):
         reason for the decision.
         """
 
+        # If this node's size is invalid (because it has a stale arvados_node_size
+        # tag), return True so that it's properly shut down.
+        if self.cloud_node.size.id == 'invalid':
+            return (True, "node's size tag '%s' not recognizable" % (self.cloud_node.extra['arvados_node_size'],))
+
         # Collect states and then consult state transition table whether we
         # should shut down.  Possible states are:
         # crunch_worker_state = ['unpaired', 'busy', 'idle', 'down']
diff --git a/services/nodemanager/tests/test_computenode_dispatch.py b/services/nodemanager/tests/test_computenode_dispatch.py
index 28492650e..778c9aeaf 100644
--- a/services/nodemanager/tests/test_computenode_dispatch.py
+++ b/services/nodemanager/tests/test_computenode_dispatch.py
@@ -356,12 +356,6 @@ class ComputeNodeMonitorActorTestCase(testutil.ActorTestMixin,
     def node_state(self, *states):
         return self.node_actor.in_state(*states).get(self.TIMEOUT)
 
-    def test_in_state_when_invalid_cloud_node_size(self):
-        self.make_mocks(1)
-        self.cloud_mock.size.id = 'invalid'
-        self.make_actor()
-        self.assertTrue(self.node_state('down'))
-
     def test_in_state_when_unpaired(self):
         self.make_actor()
         self.assertTrue(self.node_state('unpaired'))
@@ -432,6 +426,15 @@ class ComputeNodeMonitorActorTestCase(testutil.ActorTestMixin,
         self.assertEquals(self.node_actor.shutdown_eligible().get(self.TIMEOUT),
                           (False, "node state is ('unpaired', 'open', 'boot wait', 'idle exceeded')"))
 
+    def test_shutdown_when_invalid_cloud_node_size(self):
+        self.make_mocks(1)
+        self.cloud_mock.size.id = 'invalid'
+        self.cloud_mock.extra['arvados_node_size'] = 'stale.type'
+        self.make_actor()
+        self.shutdowns._set_state(True, 600)
+        self.assertEquals((True, "node's size tag 'stale.type' not recognizable"),
+                          self.node_actor.shutdown_eligible().get(self.TIMEOUT))
+
     def test_shutdown_without_arvados_node(self):
         self.make_actor(start_time=0)
         self.shutdowns._set_state(True, 600)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list