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

Introduce the retry to HTTPS access #39

Merged
merged 2 commits into from
May 18, 2021
Merged

Conversation

KengoTODA
Copy link
Contributor

When I run builds on Actions, 104.18.191.9, probably an IP address from Cloudflare, refuses connection.
Once rerun the workflow the problem can be resolved.

Here is the full log from Actions:

Run gradle/wrapper-validation-action@v1
  with:
    min-wrapper-count: 1
    allow-snapshots: false
  env:
    JAVA_HOME: /opt/hostedtoolcache/Java_Adopt_jdk/11.0.11-9/x64
Error: connect ECONNREFUSED 104.18.191.9:443

I assume it's related to #33, so here I'm going to propose to introduce the retry.

@KengoTODA KengoTODA marked this pull request as ready for review May 14, 2021 09:17
const httpc = new httpm.HttpClient(
'gradle/wrapper-validation-action',
undefined,
{allowRetries: true, maxRetries: 3}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can find this API from here: https://github.com/microsoft/typed-rest-client/blob/f21ab8a105826b64bf5c2df81e1f341537d273c0/test/units/httptests.ts#L422

This 3 has no special intention; I just thought that the default value 1 is too less.

Copy link
Contributor

Choose a reason for hiding this comment

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

Quite a reasonable change! Thanks for this!

Copy link
Contributor

@JLLeitschuh JLLeitschuh left a comment

Choose a reason for hiding this comment

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

LGTM! @eskatos thoughts?

@@ -26,7 +26,7 @@
"license": "MIT",
"dependencies": {
"@actions/core": "1.2.6",
"typed-rest-client": "1.7.3",
"typed-rest-client": "1.8.4",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This update is necessary because version 1.7.3 has no retry feature for network errors.
It was introduced by microsoft/typed-rest-client@06d0fc1 and released as a part of version 1.8.0.

Copy link
Member

@eskatos eskatos left a comment

Choose a reason for hiding this comment

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

Good stuff, thank you Kengo!

@JLLeitschuh JLLeitschuh merged commit d01b023 into gradle:master May 18, 2021
@JLLeitschuh
Copy link
Contributor

I really appreciate this change. Thank you so much for contributing it! 😄

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.

Error: getaddrinfo ENOTFOUND downloads.gradle-dn.com
3 participants