From e5626ab9c7d1b71f078b90e4c785a4aaff6d05b3 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Thu, 24 Mar 2022 18:07:51 +0100 Subject: [PATCH] Start API after conductor is started in the combined executable Change-Id: Icaffb5d346001d62e5c9522708dd44f01faeb3a6 (cherry picked from commit c5ef4b9203d396d02dde92760acd95a0912caa68) --- ironic/cmd/singleprocess.py | 6 +++--- releasenotes/notes/allinone-4ca71f150a718811.yaml | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/allinone-4ca71f150a718811.yaml diff --git a/ironic/cmd/singleprocess.py b/ironic/cmd/singleprocess.py index 675bd1bc29..28100efe9b 100644 --- a/ironic/cmd/singleprocess.py +++ b/ironic/cmd/singleprocess.py @@ -46,12 +46,12 @@ def main(): conductor_cmd.issue_startup_warnings(CONF) launcher.launch_service(mgr) - wsgi = wsgi_service.WSGIService('ironic_api', CONF.api.enable_ssl_api) - launcher.launch_service(wsgi) - # NOTE(dtantsur): handling start-up failures before launcher.wait() helps # notify systemd about them. Otherwise the launcher will report successful # service start-up before checking the threads. mgr.wait_for_start() + wsgi = wsgi_service.WSGIService('ironic_api', CONF.api.enable_ssl_api) + launcher.launch_service(wsgi) + sys.exit(launcher.wait()) diff --git a/releasenotes/notes/allinone-4ca71f150a718811.yaml b/releasenotes/notes/allinone-4ca71f150a718811.yaml new file mode 100644 index 0000000000..e99091fe12 --- /dev/null +++ b/releasenotes/notes/allinone-4ca71f150a718811.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + The combined ``ironic`` executable now starts the API only after the + built-in conductor starts. This avoids error 500 on requests while + the conductor is starting.