You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug affect both the 0.9.x (pre-releases) and the new 1.0.0.
The bug avoid HTTPAltValidator to be triggered when multiple concurrent calls are calling the same validator. This happens because numberOfAltRequestExecuted is incremented even when no alt-request is triggered so it reach very fast the limit (maxAltRequestsToExecute).
This check should be moved right before returning the alt call.
openfunc validate(response:HTTPRawResponse, forRequest request:HTTPRequestProtocol)->HTTPResponseValidatorResult{
if let statusCode = response.error?.statusCode, triggerHTTPCodes.contains(statusCode){return.passed
}// If error is one of the errors in `triggerHTTPCodes`// If we reached the maximum number of alternate calls to execute we want to cancel any other attempt.
if let maxAltRequestsToExecute = maxAltRequestsToExecute,
numberOfAltRequestExecuted > maxAltRequestsToExecute {leterror=HTTPError(.maxRetryAttemptsReached)return.failWithError(error)}
guard let altOperation =requestProvider(request, response)else{return.passed // if no retry operation is provided we'll skip and mark the validation as passed}
numberOfAltRequestExecuted +=1return.retryAfter(altOperation)}
Q
A
BC Break
yes
Version
0.9.x and 1.0.x
The text was updated successfully, but these errors were encountered:
malcommac
changed the title
Fixed for HTTPAltValidator trigger in
HTTPAltValidator not triggered with multiple concurrent calls
Feb 16, 2022
malcommac
changed the title
HTTPAltValidator not triggered with multiple concurrent calls
HTTPAltValidator not correctly triggered with multiple concurrent calls
Feb 16, 2022
Bug Report
This bug affect both the 0.9.x (pre-releases) and the new 1.0.0.
The bug avoid
HTTPAltValidator
to be triggered when multiple concurrent calls are calling the same validator. This happens becausenumberOfAltRequestExecuted
is incremented even when no alt-request is triggered so it reach very fast the limit (maxAltRequestsToExecute
).This check should be moved right before returning the alt call.
The text was updated successfully, but these errors were encountered: