From d9902c26a1f75149793b92d92968c40288f3d9ae Mon Sep 17 00:00:00 2001 From: Vlad Gusev Date: Mon, 3 Feb 2020 22:19:38 +0300 Subject: [PATCH] Configure Glance TCP socket after the store initialization When multiple stores are being used with rbd backend, Glance tries to get fsid of the cluster using rados library. If even one of the rbd backends is unavailable, glance-api wsgi fails to start properly, but continue listening on the TCP socket and is not responding at any request until the timeout. This change moves socket configuration after the store initialization to make sure that failed Glance API process will not be considered as up by the haproxy TCP check. Change-Id: I4298bb835ec60b79a0010e52318ada19eb24ad80 Related-Bug: #1861723 --- glance/common/wsgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glance/common/wsgi.py b/glance/common/wsgi.py index 95b2ebcf18..0066f7b04e 100644 --- a/glance/common/wsgi.py +++ b/glance/common/wsgi.py @@ -530,7 +530,6 @@ class BaseServer(object): """ eventlet.wsgi.MAX_HEADER_LINE = CONF.max_header_line self.client_socket_timeout = CONF.client_socket_timeout or None - self.configure_socket(old_conf, has_changed) if self.initialize_glance_store: if CONF.enabled_backends: if store_utils.check_reserved_stores(CONF.enabled_backends): @@ -541,6 +540,7 @@ class BaseServer(object): initialize_multi_store() else: initialize_glance_store() + self.configure_socket(old_conf, has_changed) def wait(self): """Wait until all servers have completed running."""