[ARVADOS] updated: 4c5455bc957b4de90eac9df0c29e9874ec6bd143

Git user git at public.curoverse.com
Fri Sep 29 10:38:55 EDT 2017


Summary of changes:
 services/nodemanager/arvnodeman/daemon.py | 6 +++++-
 services/nodemanager/tests/test_daemon.py | 9 ++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

       via  4c5455bc957b4de90eac9df0c29e9874ec6bd143 (commit)
      from  d9325bf35963f7049a2eca281618884484254de4 (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 4c5455bc957b4de90eac9df0c29e9874ec6bd143
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Fri Sep 29 11:37:17 2017 -0300

    12341: Ensure shutdown_actor.stop() is called on node_finished_shutdown.
    Updated test related to shutdown race condition.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/nodemanager/arvnodeman/daemon.py b/services/nodemanager/arvnodeman/daemon.py
index 170610e..d8087a1 100644
--- a/services/nodemanager/arvnodeman/daemon.py
+++ b/services/nodemanager/arvnodeman/daemon.py
@@ -500,13 +500,17 @@ class NodeManagerDaemonActor(actor_class):
         cloud_node_id = cloud_node.id
 
         try:
+            shutdown_actor.stop()
+        except pykka.ActorDeadError:
+            pass
+
+        try:
             record = self.cloud_nodes[cloud_node_id]
         except KeyError:
             # Cloud node was already removed from the cloud node list
             # supposedly while the destroy_node call was finishing its
             # job.
             return
-        shutdown_actor.stop()
         record.shutdown_actor = None
 
         if not success:
diff --git a/services/nodemanager/tests/test_daemon.py b/services/nodemanager/tests/test_daemon.py
index ffede75..d682080 100644
--- a/services/nodemanager/tests/test_daemon.py
+++ b/services/nodemanager/tests/test_daemon.py
@@ -401,7 +401,7 @@ class NodeManagerDaemonActorTestCase(testutil.ActorTestMixin,
         self.assertTrue(self.node_setup.start.called,
                         "second node not started after booted node stopped")
 
-    def test_booted_node_shut_down_after_being_orphaned(self):
+    def test_node_disappearing_during_shutdown(self):
         cloud_node = testutil.cloud_node_mock(6)
         setup = self.start_node_boot(cloud_node, id_num=6)
         self.daemon.node_setup_finished(setup).get(self.TIMEOUT)
@@ -414,10 +414,13 @@ class NodeManagerDaemonActorTestCase(testutil.ActorTestMixin,
         shutdown.cloud_node.get.return_value = cloud_node
         # Simulate a successful but slow node destroy call: the cloud node
         # list gets updated before the ShutdownActor finishes.
+        record = self.daemon.cloud_nodes.get().nodes.values()[0]
+        self.assertTrue(record.shutdown_actor is not None)
         self.daemon.cloud_nodes.get().nodes.clear()
         self.daemon.node_finished_shutdown(shutdown).get(self.TIMEOUT)
-        self.assertFalse(shutdown.stop.called,
-                        "shutdown actor shouldn't have been stopped")
+        self.assertTrue(
+            record.shutdown_actor is not None,
+            "test was ineffective -- failed to simulate the race condition")
 
     def test_booted_node_shut_down_when_never_listed(self):
         setup = self.start_node_boot()

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list