Merge branch 'master' into 13804-no-shutdown-wanted-nodes
[arvados.git] / services / nodemanager / arvnodeman / computenode / dispatch / __init__.py
index 30ca16805d50690f923c2d6223d17d25341e7365..77c515d565e8113681c2dad610d103fae4156a15 100644 (file)
@@ -130,7 +130,7 @@ class ComputeNodeSetupActor(ComputeNodeStateChangeBase):
     @RetryMixin._retry()
     def create_cloud_node(self):
         self._logger.info("Sending create_node request for node size %s.",
-                          self.cloud_size.name)
+                          self.cloud_size.id)
         try:
             self.cloud_node = self._cloud.create_node(self.cloud_size,
                                                       self.arvados_node)
@@ -438,6 +438,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']
@@ -458,7 +463,7 @@ class ComputeNodeMonitorActor(config.actor_class):
             boot_grace = "boot exceeded"
 
         if crunch_worker_state == "idle":
-            # Must report as "idle" at least two consecutive times
+            # Must report as "idle" at least "consecutive_idle_count" times
             if self.consecutive_idle < self.consecutive_idle_count:
                 idle_grace = 'idle wait'
             else: