-
Notifications
You must be signed in to change notification settings - Fork 85
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
Retry with backoff while publishing #340
Conversation
@eed3si9n could you please review this? |
@izharahmd Thanks for the contribution! |
ivy/src/main/scala/sbt/internal/librarymanagement/IvyActions.scala
Outdated
Show resolved
Hide resolved
ivy/src/main/scala/sbt/internal/librarymanagement/IvyUtil.scala
Outdated
Show resolved
Hide resolved
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). |
7bd8828
to
fa0f859
Compare
} | ||
|
||
object TransientNetworkException { | ||
private val _r = """.*HTTP response code: (503|429).*""".r |
There was a problem hiding this comment.
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:
- REQUEST_TIMEOUT = 408
- BAD_GATEWAY = 502
- GATEWAY_TIMEOUT = 504
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at Graldle's code it seems to extend this to all 5XX according to the comment - https://github.com/gradle/gradle/blob/master/subprojects/dependency-management/src/main/java/org/gradle/api/internal/artifacts/repositories/transport/NetworkingIssueVerifier.java#L27
There was a problem hiding this comment.
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).*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure why not?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
Refer sbt/sbt#5698
add retry with exponential backoff on transient network failure while publishing artifacts.