Skip to content

Retry with backoff while publishing #340

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

Merged
merged 1 commit into from
Sep 15, 2020

Conversation

izharahmd
Copy link
Contributor

Refer sbt/sbt#5698

add retry with exponential backoff on transient network failure while publishing artifacts.

@izharahmd
Copy link
Contributor Author

@eed3si9n could you please review this?

@eed3si9n
Copy link
Member

@izharahmd Thanks for the contribution!

@eed3si9n
Copy link
Member

I don't know how often this would be hit, but following Gradle, I'd suggest we start with max attempt of 3 including the initial attempt. This is partly to avoid overwhelming the repo under pressure, but also to make sure it doesn't look like sbt is frozen (to human or to Jenkins).

@izharahmd izharahmd force-pushed the wip/ivy-publish-with-retry-backoff branch from 7bd8828 to fa0f859 Compare September 15, 2020 15:03
@izharahmd izharahmd changed the title WIP: retry with backoff while publishing Retry with backoff while publishing Sep 15, 2020
@eed3si9n eed3si9n merged commit 18d9348 into sbt:develop Sep 15, 2020
}

object TransientNetworkException {
private val _r = """.*HTTP response code: (503|429).*""".r

Choose a reason for hiding this comment

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

What about extending the list to:

  1. REQUEST_TIMEOUT = 408
  2. BAD_GATEWAY = 502
  3. GATEWAY_TIMEOUT = 504

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should we implement this? Regex would look something like like: .*HTTP response code: (5\d{2}|408|429).*

Copy link
Member

Choose a reason for hiding this comment

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

Sure why not?

Choose a reason for hiding this comment

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

@izharahmd will you do it or should I?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rdesgroppes I have drafted the PR. Adding test cases which i missed in the last PR :)

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