Merge "Return 503 if engine overloaded/unresponsive"

This commit is contained in:
Zuul 2018-08-06 18:32:08 +00:00 committed by Gerrit Code Review
commit 672ca87558
2 changed files with 6 additions and 1 deletions

View File

@ -334,7 +334,7 @@ class DseNode(object):
except (messaging_exceptions.MessagingTimeout,
messaging_exceptions.MessageDeliveryFailure):
msg = "Request to service '%s' timed out"
raise exception.NotFound(msg % service_id)
raise exception.Unavailable(msg % service_id)
LOG.trace("<%s> RPC call returned: %s", self.node_id, result)
return result

View File

@ -132,6 +132,11 @@ class NotFound(CongressException):
code = 404
class Unavailable(CongressException):
msg_fmt = _("Service Unavailable.")
code = 503
class PolicyNotAuthorized(Forbidden):
msg_fmt = _("Policy doesn't allow %(action)s to be performed.")