Skip to content
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

only retry downloadtool on 500s and 408 and 429 #373

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

ericsciple
Copy link
Contributor

@ericsciple ericsciple commented Mar 9, 2020

downloadtool should only retry on 500s and 408 and 429

let attempt = 1
while (attempt < this.maxAttempts) {
// Try
try {
return await action()
} catch (err) {
if (isRetryable && !isRetryable(err)) {
throw err
Copy link
Contributor Author

@ericsciple ericsciple Mar 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was happy to learn nodejs retains the original stack trace when an exception is rethrown

@ericsciple ericsciple changed the title [draft] dont retry downloadtool on 404 dont retry downloadtool on 404 Mar 9, 2020
@ericsciple ericsciple requested a review from thboop March 9, 2020 14:45
Copy link
Collaborator

@thboop thboop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor thoughts

if (err instanceof HTTPError && err.httpStatusCode) {
// Don't retry anything less than 400
// Don't retry 404 Not Found
if (err.httpStatusCode < 400 || err.httpStatusCode === 404) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most 4xx responses are not retryable, the only one we should really retry for is 408- Request timeout and 429- Rate Limiting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

packages/tool-cache/src/tool-cache.ts Show resolved Hide resolved
expect(info).toHaveLength(0)
})

it('checks retryable after second attempt', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i want to learn

@ericsciple ericsciple force-pushed the users/ericsciple/m167retry branch from 835cbef to 6797a48 Compare March 9, 2020 16:01
@ericsciple ericsciple changed the title dont retry downloadtool on 404 dont retry downloadtool on 400s except 408 and 429 Mar 9, 2020
@ericsciple ericsciple changed the title dont retry downloadtool on 400s except 408 and 429 only retry downloadtool on 500s and 408 and 429 Mar 9, 2020
@ericsciple ericsciple force-pushed the users/ericsciple/m167retry branch from 6797a48 to 728942f Compare March 9, 2020 17:06
Copy link
Collaborator

@thboop thboop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ericsciple ericsciple force-pushed the users/ericsciple/m167retry branch from 728942f to abde3c6 Compare March 9, 2020 18:25
@ericsciple ericsciple force-pushed the users/ericsciple/m167retry branch from abde3c6 to 3dedf1c Compare March 9, 2020 18:28
@ericsciple ericsciple merged commit 5859d71 into master Mar 9, 2020
@ericsciple ericsciple deleted the users/ericsciple/m167retry branch March 9, 2020 18:35
Copy link

@immense055 immense055 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

expect(info).toHaveLength(0)
})

it('checks retryable after second attempt', async () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i want to learn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants