summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-09 14:43:50 +0000
committerGerrit Code Review <review@openstack.org>2019-01-09 14:43:50 +0000
commit074ee6b7a7a95afcbf9a250da271633dcede3685 (patch)
treee684782231535c9caacc052b06e00f85e2cb205e
parente476cfbc32815353e51bd1fb136bbccfa32b8e06 (diff)
parent47aa6b12b2c9d819a626934e0ab98e7767d44bab (diff)
Merge "Ensure command_socket is last thing to close"
-rw-r--r--zuul/executor/server.py2
-rw-r--r--zuul/lib/fingergw.py15
-rw-r--r--zuul/merger/server.py2
3 files changed, 10 insertions, 9 deletions
diff --git a/zuul/executor/server.py b/zuul/executor/server.py
index 71f1c8a..5eca20c 100644
--- a/zuul/executor/server.py
+++ b/zuul/executor/server.py
@@ -2320,7 +2320,6 @@ class ExecutorServer(object):
2320 self._running = False 2320 self._running = False
2321 self._command_running = False 2321 self._command_running = False
2322 workers = list(self.job_workers.values()) 2322 workers = list(self.job_workers.values())
2323 self.command_socket.stop()
2324 2323
2325 for job_worker in workers: 2324 for job_worker in workers:
2326 try: 2325 try:
@@ -2351,6 +2350,7 @@ class ExecutorServer(object):
2351 self.statsd.gauge(base_key + '.pct_used_ram', 0) 2350 self.statsd.gauge(base_key + '.pct_used_ram', 0)
2352 self.statsd.gauge(base_key + '.running_builds', 0) 2351 self.statsd.gauge(base_key + '.running_builds', 0)
2353 2352
2353 self.command_socket.stop()
2354 self.log.debug("Stopped") 2354 self.log.debug("Stopped")
2355 2355
2356 def join(self): 2356 def join(self):
diff --git a/zuul/lib/fingergw.py b/zuul/lib/fingergw.py
index 51cfa91..4f603f3 100644
--- a/zuul/lib/fingergw.py
+++ b/zuul/lib/fingergw.py
@@ -184,13 +184,6 @@ class FingerGateway(object):
184 self.log.info("Finger gateway is started") 184 self.log.info("Finger gateway is started")
185 185
186 def stop(self): 186 def stop(self):
187 if self.command_socket:
188 self.command_running = False
189 try:
190 self.command_socket.stop()
191 except Exception:
192 self.log.exception("Error stopping command socket:")
193
194 if self.server: 187 if self.server:
195 try: 188 try:
196 self.server.shutdown() 189 self.server.shutdown()
@@ -206,6 +199,14 @@ class FingerGateway(object):
206 except Exception: 199 except Exception:
207 self.log.exception("Error stopping RCP client:") 200 self.log.exception("Error stopping RCP client:")
208 201
202 if self.command_socket:
203 self.command_running = False
204
205 try:
206 self.command_socket.stop()
207 except Exception:
208 self.log.exception("Error stopping command socket:")
209
209 self.log.info("Finger gateway is stopped") 210 self.log.info("Finger gateway is stopped")
210 211
211 def wait(self): 212 def wait(self):
diff --git a/zuul/merger/server.py b/zuul/merger/server.py
index b7d0fd4..a2f2303 100644
--- a/zuul/merger/server.py
+++ b/zuul/merger/server.py
@@ -87,8 +87,8 @@ class MergeServer(object):
87 self.log.debug("Stopping") 87 self.log.debug("Stopping")
88 self._running = False 88 self._running = False
89 self._command_running = False 89 self._command_running = False
90 self.command_socket.stop()
91 self.worker.shutdown() 90 self.worker.shutdown()
91 self.command_socket.stop()
92 self.log.debug("Stopped") 92 self.log.debug("Stopped")
93 93
94 def join(self): 94 def join(self):