Skip to content

Conversation

@jorgee
Copy link
Contributor

@jorgee jorgee commented May 26, 2025

This PR include retries when performing request in git repositories.

The request errors are managed at RepositoryProvider.checkResponse, where some AbortException or RateLimitExceededExceptions are thrown for some HTTP error codes, or by IOExceptions thrown by the URLConnection methods. They include SocketExceptions and 50X error codes. I have made all IOExceptions retried by default, but this could be modified by including other codes in the checkResponse method.

Signed-off-by: jorgee <jorge.ejarque@seqera.io>
@jorgee jorgee requested a review from a team as a code owner May 26, 2025 13:30
@jorgee jorgee linked an issue May 26, 2025 that may be closed by this pull request
@netlify
Copy link

netlify bot commented May 26, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 02fc98b
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6852d34462679c00080e0825

Copy link
Collaborator

@christopher-hakkaart christopher-hakkaart left a comment

Choose a reason for hiding this comment

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

Documentation changes look great.

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman bentsherman requested a review from a team as a code owner May 30, 2025 18:03
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman
Copy link
Member

bentsherman commented May 30, 2025

I have added nextflow.retryPolicy and used it for the following operations:

  • git repository provider
  • k8s client (replaces k8s.client.retryPolicy)
  • file publishing (replaces workflow.output.retryPolicy)

There are a few other places that use retry settings, namely the grid and cloud executors. In a future iteration I think we could consolidate them as well, perhaps using the $<name> syntax in the executor scope to apply different settings to different contexts

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman bentsherman requested a review from pditommaso May 31, 2025 17:36
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@pditommaso pditommaso force-pushed the master branch 3 times, most recently from b4b321e to 069653d Compare June 4, 2025 18:54
// Other methods can throw IOExceptions including for 50x response codes which are retried by default.
if( t instanceof RateLimitExceededException || t.cause instanceof RateLimitExceededException)
return true
if( t instanceof IOException || t.cause instanceof IOException )
Copy link
Member

Choose a reason for hiding this comment

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

IOException is too generic. It would be preferable having a more granular control on http error codes here.

However it can be difficult to achieve this in the current implementation. Wonder if it should be used a different http client (see WaveClient)

@pditommaso
Copy link
Member

This is the PR implementing the use of Java HttpClient #6188

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Comment on lines +442 to +450
try {
def config = getConfig0()
def manifestOpts = config.manifest as Map ?: Collections.emptyMap()
return new Manifest(manifestOpts)
}
catch( Exception e ) {
log.warn "Cannot read project config -- Cause: ${e.message ?: e}"
return new Manifest(Collections.emptyMap())
}
Copy link
Member

Choose a reason for hiding this comment

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

Likely this is not needed anymore, because the retry strategy works at a lower level

Copy link
Member

Choose a reason for hiding this comment

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

what do you mean?

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@bentsherman bentsherman requested a review from pditommaso June 18, 2025 13:29
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@pditommaso
Copy link
Member

Since there are several overlapping changes I've created a new PR. Closing this in favour of #6195

@pditommaso pditommaso closed this Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retry Mechanism for GitHub Connectivity Failures in Automated Workflows

5 participants