Retry on internal server error 98
Change-Id: I4dbc7d1f34b7d7672b8fca8e8667e2d266faca14
This commit is contained in:
parent
03fd42824e
commit
da52509951
@ -46,7 +46,8 @@ def http_error_to_exception(status_code, error_code):
|
||||
requests.codes.CONFLICT: exceptions.StaleRevision,
|
||||
requests.codes.PRECONDITION_FAILED: exceptions.StaleRevision,
|
||||
requests.codes.INTERNAL_SERVER_ERROR:
|
||||
{'99': exceptions.ClientCertificateNotTrusted,
|
||||
{'98': exceptions.CannotConnectToServer,
|
||||
'99': exceptions.ClientCertificateNotTrusted,
|
||||
'607': exceptions.APITransactionAborted},
|
||||
requests.codes.FORBIDDEN:
|
||||
{'98': exceptions.BadXSRFToken},
|
||||
@ -325,7 +326,9 @@ class NSX3Client(JSONRESTClient):
|
||||
def _rest_call(self, url, **kwargs):
|
||||
if kwargs.get('with_retries', True):
|
||||
# Retry on "607: Persistence layer is currently reconfiguring"
|
||||
retry_codes = [exceptions.APITransactionAborted]
|
||||
# and on "98: Cannot connect to server"
|
||||
retry_codes = [exceptions.APITransactionAborted,
|
||||
exceptions.CannotConnectToServer]
|
||||
if self.rate_limit_retry:
|
||||
# If too many requests are handled by the nsx at the same time,
|
||||
# error "429: Too Many Requests" or "503: Server Unavailable"
|
||||
|
@ -221,10 +221,14 @@ class NsxOverlapVlan(NsxLibInvalidInput):
|
||||
"physical devices resulting in a conflict")
|
||||
|
||||
|
||||
class APITransactionAborted(ServerBusy):
|
||||
class APITransactionAborted(ManagerError):
|
||||
message = _("API transaction aborted as MP cluster is reconfiguring")
|
||||
|
||||
|
||||
class CannotConnectToServer(ManagerError):
|
||||
message = _("Cannot connect to server")
|
||||
|
||||
|
||||
class ResourceInUse(ManagerError):
|
||||
message = _("The object cannot be deleted as either it has children or it "
|
||||
"is being referenced by other objects")
|
||||
|
Loading…
x
Reference in New Issue
Block a user