From 4b58446d376186cb3324beb35bc1607d6b50eae3 Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Thu, 8 Apr 2021 21:28:39 +0000 Subject: [PATCH] Revert "Move back to mod_wsgi for devstack" This reverts commit 185d92d230bdf8149b3ae3f6d1730ec23c0514d7. Reason for revert: Lets try to move back to uwsgi, as logging is a lot cleaner in the CI with uwsgi. Switches uwsgi from using uwsgi over socket to over localhost HTTP. This patch also bumps the API_WORKERS setting for devstack from 2 to 4. This will bump the uwsgi processes and threads from two to four. Change-Id: I126133564e2ada32448ad36e0d021790939425d4 --- .zuul.yaml | 1 + designate/api/middleware.py | 3 +++ devstack/plugin.sh | 5 +++++ devstack/settings | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.zuul.yaml b/.zuul.yaml index 1fc0a07bd..8b3085ccc 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -6,6 +6,7 @@ DESIGNATE_SERVICE_PORT_DNS: 5322 TEMPEST_PLUGINS: /opt/stack/designate-tempest-plugin USE_PYTHON3: true + API_WORKERS: 4 devstack_plugins: designate: https://opendev.org/openstack/designate devstack_services: diff --git a/designate/api/middleware.py b/designate/api/middleware.py index 07fd46b16..334da69cd 100644 --- a/designate/api/middleware.py +++ b/designate/api/middleware.py @@ -237,6 +237,7 @@ class FaultWrapperMiddleware(base.Middleware): try: return request.get_response(self.application) except exceptions.DesignateException as e: + LOG.exception(e) # Handle Designate Exceptions status = e.error_code if hasattr(e, 'error_code') else 500 @@ -256,6 +257,7 @@ class FaultWrapperMiddleware(base.Middleware): return self._handle_exception(request, e, status, response) except messaging.MessagingTimeout as e: + LOG.exception(e) # Special case for RPC timeout's response = { 'code': 504, @@ -264,6 +266,7 @@ class FaultWrapperMiddleware(base.Middleware): return self._handle_exception(request, e, 504, response) except Exception as e: + LOG.exception(e) # Handle all other exception types return self._handle_exception(request, e) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 6e1209d68..0c67a8c60 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -122,6 +122,11 @@ function configure_designate { if [[ "$DESIGNATE_WSGI_MODE" == "uwsgi" ]]; then write_uwsgi_config "$DESIGNATE_UWSGI_CONF" "$DESIGNATE_UWSGI" "/dns" + # We are using the http transport to work around an issue with + # broken connections when using the uwsgi protocol of a local socket + # See bug: https://github.com/unbit/uwsgi/issues/2368 + echo 'ProxyPass "/dns" "http://127.0.0.1:60053" retry=0' | sudo tee /etc/apache2/sites-available/designate-api-wsgi.conf + iniset $DESIGNATE_UWSGI_CONF uwsgi http-socket 127.0.0.1:60053 else _config_designate_apache_wsgi fi diff --git a/devstack/settings b/devstack/settings index cd3a70314..88d9461c3 100644 --- a/devstack/settings +++ b/devstack/settings @@ -10,7 +10,7 @@ DESIGNATE_PERIODIC_SYNC_INTERVAL=${DESIGNATE_PERIODIC_SYNC_INTERVAL:-1800} DESIGNATE_COORDINATION_URL=${DESIGNATE_COORDINATION_URL:-"memcached://127.0.0.1:11211"} DESIGNATE_POLL_INTERVAL=${DESIGNATE_POLL_INTERVAL:-5} DESIGNATE_POLL_RETRIES=${DESIGNATE_POLL_RETRIES:-6} -DESIGNATE_WSGI_MODE=${DESIGNATE_WSGI_MODE:-"mod_wsgi"} +DESIGNATE_WSGI_MODE=${DESIGNATE_WSGI_MODE:-"uwsgi"} # Quota Options DESIGNATE_QUOTA_ZONES=${DESIGNATE_QUOTA_ZONES:-10}