[FEATURE] handle auto-retries for requests failed before sending the message to the receiver - reqwest #4366
Labels
C-feature
Category: Feature request or enhancement
S-awaiting-triage
Status: New issues that have not been assessed yet
Feature Description
We intermittently face
Connection reset by peer (os error 104)
in sandbox while calling the connector APIs. This probably happens due to reqwest's hyper using stale connections - @Narayanbhat166The APIs fail intermittently and does not follow a pattern. This makes it an inconvenience for the HyperSwitch consumers as all they can see is 500 errors with the message "Something went wrong". This is not ideal and steps can be taken to mitigate this scenario.
First steps would be probably to let the consumer know that this failed at the client's end (HyperSwitch being the client, and underlying connector being the server), and such errors are retryable. Once these kinds of errors are propogated to the consumer, they will be able to take a decision on whether or not to retry the failed operation.
Second step would be providing a config for controlling maximum number of retries that can be made on failed requests. As requests can be failed due to a lot of different reasons, it's important to consider retries only for the requests which had failed before completion of sending the full request. Such scenarios are listed below -
Possible Implementation
Propagate retryable errors to the consumer
handle_response
hereAdd retry functionality for connector API requests
retry_if
. It lets us retry anyFuture
based on the conditions providedmerchant_account
and used while calling connector's APISample code
Have you spent some time checking if this feature request has been raised before?
Have you read the Contributing Guidelines?
Are you willing to submit a PR?
None
The text was updated successfully, but these errors were encountered: