-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom retry codes for @actions/http-client
#1569
Labels
enhancement
New feature or request
Comments
janssen-tiobe
added a commit
to janssen-tiobe/actions-toolkit
that referenced
this issue
Oct 24, 2023
Extended the `RequestOptions` interface with `retryCodes` and `noRetryCodes` options, added the implementation for that in `index.js` by creating the function `_shouldRetryOnCode`, which has the hierarchy `retryCodes` > `noRetryCodes` > `DefaultHttpResponseRetryCodes`. Also fixed the failing unit tests by updating the imports (can be reverted if that was not needed, but in my case it was) and wrote new unit tests for the retry mechanism. Wrote the unit tests by adding the variable `retryCount` to `HttpClientResponse` to be able to track the amount of retries done. This is also very usefull for logging in production, as there is no current method for that.
janssen-tiobe
added a commit
to janssen-tiobe/actions-toolkit
that referenced
this issue
Oct 24, 2023
Extended the `RequestOptions` interface with `retryCodes` and `noRetryCodes` options, added the implementation for that in `index.js` by creating the function `_shouldRetryOnCode`, which has the hierarchy `retryCodes` > `noRetryCodes` > `DefaultHttpResponseRetryCodes`. Also fixed the failing unit tests by updating the imports (can be reverted if that was not needed, but in my case it was) and wrote new unit tests for the retry mechanism. Wrote the unit tests by adding the variable `retryCount` to `HttpClientResponse` to be able to track the amount of retries done. This is also very usefull for logging in production, as there is no current method for that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We use the
@actions/http-client
to be able to easily retry http requests on failed requests.The problem is that currently only 502, 503 and 504 are retried, but in our implementation we also need 500 to be retried.
I want to propose a mechanism where retry codes can be added or removed by the user by appending the
RequestOptions
withretryOnCodes
andnoRetryOnCodes
to have the full controll on what statuscodes should be retried and not.The text was updated successfully, but these errors were encountered: