fix(node): don't retry 500 code responses #1891
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In general node shouldn't return 500 code. And I don't know cases when it should be retried.
Also, it looks like our API gateway has a kind of protection of doing frequent requests that fail with 500 code: there is an exponentially growing delay in receiving a response.
For example, I was retrying https://testnet.aeternity.io/v3/dry-run
requested at 2023-08-27T16:23:08.129Z
responded at 2023-08-27T16:23:13.594Z with 500 code in 5 seconds
requested at 2023-08-27T16:23:13.652Z
responded at 2023-08-27T16:23:28.214Z with 500 code in 15 seconds
requested at 2023-08-27T16:23:28.444Z
responded at 2023-08-27T16:24:16.582Z with 500 code in 48 seconds
requested at 2023-08-27T16:24:17.096Z
responded at 2023-08-27T16:26:04.847Z with 500 code in 107 seconds
So, in this case, request retrying making the overall process extremely long, I'm proposing to disable it.
This PR is supported by the Æternity Crypto Foundation