Skip to content

Commit cbd7797

Browse files
authored
Shutdown global thread pool last (#3569)
Ha.shutdown() needs it to run some health checks Ref #3526
1 parent 5bb4cc8 commit cbd7797

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

patroni/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ def _shutdown(self) -> None:
257257
"""
258258
from patroni import thread_pool
259259

260-
thread_pool.get_executor().shutdown(wait=False)
261-
262260
try:
263261
self.api.shutdown()
264262
except Exception:
@@ -268,6 +266,8 @@ def _shutdown(self) -> None:
268266
except Exception:
269267
logger.exception('Exception during Ha.shutdown')
270268

269+
thread_pool.get_executor().shutdown(wait=False)
270+
271271

272272
def patroni_main(configfile: str) -> None:
273273
"""Configure and start ``patroni`` main daemon process.

0 commit comments

Comments
 (0)