commit 6395b4fe8ed99855853587fa93cb59fd2691aed5
Author: Anton Kurbatov <email address hidden>
Date: Mon Mar 25 18:49:52 2024 +0000
Fixing the 500 HTTP code in the metadata service if Nova is down
If the Nova metadata service is unavailable, the requests.request()
function may raise a ConnectionError. This results in the upper code
returning a 500 HTTP status code to the user along with a traceback.
Let's handle this scenario and instead return a 503 HTTP status code
(service unavailable).
If the Nova service is down and is behind another proxy (such as
Nginx), then instead of a ConnectionError, the request may result in
receiving a 502 or 503 HTTP status code. Let's also consider this
situation and add support for an additional 504 code.
Reviewed: https:/ /review. opendev. org/c/openstack /neutron/ +/914154 /opendev. org/openstack/ neutron/ commit/ 6395b4fe8ed9985 5853587fa93cb59 fd2691aed5
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 6395b4fe8ed9985 5853587fa93cb59 fd2691aed5
Author: Anton Kurbatov <email address hidden>
Date: Mon Mar 25 18:49:52 2024 +0000
Fixing the 500 HTTP code in the metadata service if Nova is down
If the Nova metadata service is unavailable, the requests.request()
function may raise a ConnectionError. This results in the upper code
returning a 500 HTTP status code to the user along with a traceback.
Let's handle this scenario and instead return a 503 HTTP status code
(service unavailable).
If the Nova service is down and is behind another proxy (such as
Nginx), then instead of a ConnectionError, the request may result in
receiving a 502 or 503 HTTP status code. Let's also consider this
situation and add support for an additional 504 code.
Closes-Bug: #2059032 224b0793dc385b0 ddec01739c4
Change-Id: I16be18c46a6796