Esempio n. 1
0
 def test_shutdown(self):
     clusters = [
         MesosClusterRepository.get_cluster(address)
         for address in ['a', 'b', 'c']
     ]
     assert_equal(self.cluster_cls.call_count, 3)
     MesosClusterRepository.shutdown()
     for cluster in clusters:
         assert_equal(cluster.stop.call_count, 1)
Esempio n. 2
0
 def test_shutdown(self):
     clusters = [
         MesosClusterRepository.get_cluster(address)
         for address in ['a', 'b', 'c']
     ]
     assert_equal(self.cluster_cls.call_count, 3)
     MesosClusterRepository.shutdown()
     for cluster in clusters:
         assert_equal(cluster.stop.call_count, 1)
Esempio n. 3
0
 def _handle_shutdown(self, sig_num, stack_frame):
     log.info("Shutdown requested via %s" % sig_num)
     reactor.callLater(0, reactor.stop)
     waited = 0
     while reactor.running:
         if waited > 5:
             log.error("timed out waiting for reactor shutdown")
             break
         time.sleep(0.1)
         waited += 0.1
     if self.mcp:
         self.mcp.shutdown()
     MesosClusterRepository.shutdown()
     self.context.terminate(sig_num, stack_frame)
Esempio n. 4
0
 def _handle_shutdown(self, sig_num, stack_frame):
     log.info(f"Shutdown requested via {str(sig_num)}")
     reactor.callLater(0, reactor.stop)
     waited = 0
     while reactor.running:
         if waited > 5:
             log.error("timed out waiting for reactor shutdown")
             break
         time.sleep(0.1)
         waited += 0.1
     if self.mcp:
         self.mcp.shutdown()
     MesosClusterRepository.shutdown()
     raise SystemExit(f"Terminating on signal {str(sig_num)}")
Esempio n. 5
0
 def _handle_shutdown(self, sig_num, stack_frame):
     log.info(f"Shutdown requested via {str(sig_num)}")
     reactor.callLater(0, reactor.stop)
     waited = 0
     while reactor.running:
         if waited > 5:
             log.error("timed out waiting for reactor shutdown")
             break
         time.sleep(0.1)
         waited += 0.1
     if self.mcp:
         self.mcp.shutdown()
     MesosClusterRepository.shutdown()
     raise SystemExit(f"Terminating on signal {str(sig_num)}")