Skip to content

Replace custom retry strategy with HxClient in RepositoryProvider #6351

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pditommaso
Copy link
Member

Summary

This PR replaces the custom Failsafe-based retry strategy in RepositoryProvider with the standardized HxClient retry mechanism from lib-seqera, consolidating retry handling across the Nextflow codebase.

Key Changes

  • Removed custom retry implementation (~70 lines of Failsafe-based retry logic)
  • Integrated HxClient with HxConfig for sophisticated retry configuration
  • Upgraded lib-httpx dependency from 1.0.0 to 1.2.0 to support HxConfig
  • Maintained backward compatibility by preserving setRetryConfig() and isRetryable() method signatures
  • Preserved all functionality including HTTP redirect handling for GitHub repository renames

Benefits

  • Consistent retry strategy: All HTTP operations now use the same HxClient-based retry mechanism
  • Reduced code complexity: Eliminated custom retry implementation in favor of centralized lib-seqera solution
  • Better maintainability: Retry logic is now managed in a single location
  • Enhanced configuration: More sophisticated retry policies through HxConfig

Implementation Details

The retry logic now uses HxConfig.builder() to configure:

  • Retry conditions: Same exception types (SocketException, excluding UnresolvedAddressException)
  • Retry status codes: HTTP 429, 500, 502, 503, 504
  • Retry configuration: Uses existing RetryConfig for delays, max attempts, jitter, etc.

Test Coverage

  • ✅ All repository provider tests pass (GitHub, GitLab, Bitbucket, etc.)
  • ✅ HTTP redirect functionality verified (renamed repository test)
  • ✅ nf-commons smoke test passes
  • ✅ Maintains compatibility with existing retry behavior

🤖 Generated with Claude Code

- Remove custom Failsafe-based retry implementation (~70 lines)
- Replace with HxClient using HxConfig for centralized retry handling
- Upgrade lib-httpx dependency from 1.0.0 to 1.2.0 for HxConfig support
- Maintain backward compatibility with setRetryConfig() and isRetryable() methods
- Preserve all existing functionality including HTTP redirect handling
- Consolidate retry logic across Nextflow to use consistent HxClient approach

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link

netlify bot commented Aug 19, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 9e71fb2
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/68a4e3a9354be50008bbad5d

The custom retry implementation tests are no longer applicable since
retry logic is now centralized in HxClient. The retry functionality
is thoroughly tested via integration tests in all repository providers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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.

2 participants