Skip to content

Replace custom retry strategy with HxClient in RepositoryProvider#6351

Merged
pditommaso merged 4 commits intomasterfrom
replace-custom-retry-with-hxclient
Sep 3, 2025
Merged

Replace custom retry strategy with HxClient in RepositoryProvider#6351
pditommaso merged 4 commits intomasterfrom
replace-custom-retry-with-hxclient

Conversation

@pditommaso
Copy link
Member

@pditommaso pditommaso commented Aug 19, 2025

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 2.0.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 <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Aug 19, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 2e10ad8
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/68b8a38d42e3e700098c0aee

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 <noreply@anthropic.com>
@pditommaso
Copy link
Member Author

Depend on #6354

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso pditommaso merged commit af8ba8c into master Sep 3, 2025
9 checks passed
@pditommaso pditommaso deleted the replace-custom-retry-with-hxclient branch September 3, 2025 20:57
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