Browse Source

Merge "Ensure command_socket is last thing to close"

tags/3.5.0
Zuul 5 months ago
parent
commit
074ee6b7a7
3 changed files with 10 additions and 9 deletions
  1. 1
    1
      zuul/executor/server.py
  2. 8
    7
      zuul/lib/fingergw.py
  3. 1
    1
      zuul/merger/server.py

+ 1
- 1
zuul/executor/server.py View File

@@ -2320,7 +2320,6 @@ class ExecutorServer(object):
2320 2320
             self._running = False
2321 2321
             self._command_running = False
2322 2322
             workers = list(self.job_workers.values())
2323
-        self.command_socket.stop()
2324 2323
 
2325 2324
         for job_worker in workers:
2326 2325
             try:
@@ -2351,6 +2350,7 @@ class ExecutorServer(object):
2351 2350
             self.statsd.gauge(base_key + '.pct_used_ram', 0)
2352 2351
             self.statsd.gauge(base_key + '.running_builds', 0)
2353 2352
 
2353
+        self.command_socket.stop()
2354 2354
         self.log.debug("Stopped")
2355 2355
 
2356 2356
     def join(self):

+ 8
- 7
zuul/lib/fingergw.py View File

@@ -184,13 +184,6 @@ class FingerGateway(object):
184 184
         self.log.info("Finger gateway is started")
185 185
 
186 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 187
         if self.server:
195 188
             try:
196 189
                 self.server.shutdown()
@@ -206,6 +199,14 @@ class FingerGateway(object):
206 199
             except Exception:
207 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 210
         self.log.info("Finger gateway is stopped")
210 211
 
211 212
     def wait(self):

+ 1
- 1
zuul/merger/server.py View File

@@ -87,8 +87,8 @@ class MergeServer(object):
87 87
         self.log.debug("Stopping")
88 88
         self._running = False
89 89
         self._command_running = False
90
-        self.command_socket.stop()
91 90
         self.worker.shutdown()
91
+        self.command_socket.stop()
92 92
         self.log.debug("Stopped")
93 93
 
94 94
     def join(self):

Loading…
Cancel
Save