Merge "Ensure command_socket is last thing to close"
This commit is contained in:
commit
074ee6b7a7
|
@ -2320,7 +2320,6 @@ class ExecutorServer(object):
|
||||||
self._running = False
|
self._running = False
|
||||||
self._command_running = False
|
self._command_running = False
|
||||||
workers = list(self.job_workers.values())
|
workers = list(self.job_workers.values())
|
||||||
self.command_socket.stop()
|
|
||||||
|
|
||||||
for job_worker in workers:
|
for job_worker in workers:
|
||||||
try:
|
try:
|
||||||
|
@ -2351,6 +2350,7 @@ class ExecutorServer(object):
|
||||||
self.statsd.gauge(base_key + '.pct_used_ram', 0)
|
self.statsd.gauge(base_key + '.pct_used_ram', 0)
|
||||||
self.statsd.gauge(base_key + '.running_builds', 0)
|
self.statsd.gauge(base_key + '.running_builds', 0)
|
||||||
|
|
||||||
|
self.command_socket.stop()
|
||||||
self.log.debug("Stopped")
|
self.log.debug("Stopped")
|
||||||
|
|
||||||
def join(self):
|
def join(self):
|
||||||
|
|
|
@ -184,13 +184,6 @@ class FingerGateway(object):
|
||||||
self.log.info("Finger gateway is started")
|
self.log.info("Finger gateway is started")
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
if self.command_socket:
|
|
||||||
self.command_running = False
|
|
||||||
try:
|
|
||||||
self.command_socket.stop()
|
|
||||||
except Exception:
|
|
||||||
self.log.exception("Error stopping command socket:")
|
|
||||||
|
|
||||||
if self.server:
|
if self.server:
|
||||||
try:
|
try:
|
||||||
self.server.shutdown()
|
self.server.shutdown()
|
||||||
|
@ -206,6 +199,14 @@ class FingerGateway(object):
|
||||||
except Exception:
|
except Exception:
|
||||||
self.log.exception("Error stopping RCP client:")
|
self.log.exception("Error stopping RCP client:")
|
||||||
|
|
||||||
|
if self.command_socket:
|
||||||
|
self.command_running = False
|
||||||
|
|
||||||
|
try:
|
||||||
|
self.command_socket.stop()
|
||||||
|
except Exception:
|
||||||
|
self.log.exception("Error stopping command socket:")
|
||||||
|
|
||||||
self.log.info("Finger gateway is stopped")
|
self.log.info("Finger gateway is stopped")
|
||||||
|
|
||||||
def wait(self):
|
def wait(self):
|
||||||
|
|
|
@ -87,8 +87,8 @@ class MergeServer(object):
|
||||||
self.log.debug("Stopping")
|
self.log.debug("Stopping")
|
||||||
self._running = False
|
self._running = False
|
||||||
self._command_running = False
|
self._command_running = False
|
||||||
self.command_socket.stop()
|
|
||||||
self.worker.shutdown()
|
self.worker.shutdown()
|
||||||
|
self.command_socket.stop()
|
||||||
self.log.debug("Stopped")
|
self.log.debug("Stopped")
|
||||||
|
|
||||||
def join(self):
|
def join(self):
|
||||||
|
|
Loading…
Reference in New Issue