12085: Unconditionally remove the idle time counter of paired missing nodes.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Thu, 5 Apr 2018 14:37:49 +0000 (11:37 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Thu, 5 Apr 2018 14:37:49 +0000 (11:37 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

services/nodemanager/arvnodeman/daemon.py

index 3147de328a9df1332edaf83e7e5d5cfd14b8caf0..1b9f1e70ccc7cbf7b85b37f74e865d3e8a81964d 100644 (file)
@@ -215,15 +215,13 @@ class NodeManagerDaemonActor(actor_class):
             if hasattr(record.cloud_node, "_nodemanager_recently_booted"):
                 self.cloud_nodes.add(record)
             else:
-                # Node disappeared from the cloud node list.  Stop the monitor
-                # actor if necessary and forget about the node.
+                # Node disappeared from the cloud node list. If it's paired,
+                # remove its idle time counter.
+                if record.arvados_node:
+                    status.tracker.idle_out(record.arvados_node.get('hostname'))
+                # Stop the monitor actor if necessary and forget about the node.
                 if record.actor:
                     try:
-                        # If it's paired and idle, stop its idle time counter
-                        # before removing the monitor actor.
-                        if record.actor.get_state().get() == 'idle':
-                            status.tracker.idle_out(
-                                record.actor.arvados_node.get()['hostname'])
                         record.actor.stop()
                     except pykka.ActorDeadError:
                         pass