def _soft_disconnect(self, fast=False): if self.building: # wait until build finished return # a negative build_wait_timeout means the worker should never be shut # down, so just disconnect. if self.build_wait_timeout < 0: yield AbstractWorker.disconnect(self) return self.stopMissingTimer() # if master is stopping, we will never achieve consistent state, as workermanager # won't accept new connection if self._substantiation_notifier and self.master.running: log.msg("Weird: Got request to stop before started. Allowing " "worker to start cleanly to avoid inconsistent state") yield self._substantiation_notifier.wait() self.substantiation_build = None log.msg("Substantiation complete, immediately terminating.") if self.conn is not None: yield defer.DeferredList( [AbstractWorker.disconnect(self), self.insubstantiate(fast)], consumeErrors=True, fireOnOneErrback=True) else: yield AbstractWorker.disconnect(self) yield self.stop_instance(fast)
def _soft_disconnect(self, fast=False): if self.building: # wait until build finished return # a negative build_wait_timeout means the worker should never be shut # down, so just disconnect. if self.build_wait_timeout < 0: yield AbstractWorker.disconnect(self) return if self.missing_timer: self.missing_timer.cancel() self.missing_timer = None # if master is stopping, we will never achieve consistent state, as workermanager # wont accept new connection if self._substantiation_notifier and self.master.running: log.msg("Weird: Got request to stop before started. Allowing " "worker to start cleanly to avoid inconsistent state") yield self._substantiation_notifier.wait() self.substantiation_build = None log.msg("Substantiation complete, immediately terminating.") if self.conn is not None: yield defer.DeferredList([ AbstractWorker.disconnect(self), self.insubstantiate(fast) ], consumeErrors=True, fireOnOneErrback=True) else: yield AbstractWorker.disconnect(self) yield self.stop_instance(fast)
def _disconnect(res): log.msg("VM destroyed (%s): Forcing its connection closed." % self.workername) return AbstractWorker.disconnect(self)