Manager-level retry handler configuration#87
Merged
Conversation
Add integration tests for retry handler wiring through DownloadManager. Tests verify retry count, event emission, custom policies, and default (no retry) behaviour. Tests will fail until manager accepts retry_handler parameter.
The field was never wired through to workers. Retry configuration will be manager-level only.
Updates WorkerFactory protocol to accept an optional retry handler, threads it through WorkerPool (including test fixtures) so workers receive the configured handler.
DownloadManager now accepts optional retry_handler and passes it through to WorkerPool. Users can enable retries via DownloadManager(retry_handler=RetryHandler(RetryConfig(...))). Integration tests now pass.
- Update ARCHITECTURE.md with retry_handler in DownloadManager and WorkerPool - Update README.md retry section to show manager-level configuration - Remove outdated note about retry requiring direct worker instantiation - Add custom retry handler example for advanced scenarios
Demonstrates manager-level retry handler injection with: - Basic retry handler with exponential backoff - Custom retry policy (treating 404 as transient) - RETRYING event subscription for observability - Comparison with no-retry default behaviour Uses httpbin.org/status/* endpoints to reliably trigger retries.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
retry_handlerparameter toDownloadManagerfor centralized retry configurationWorkerPoolto all workersFileConfig.max_retries(was never used)Changes
DownloadManager: accepts optionalretry_handler, wires emitterWorkerPool: accepts and passesretry_handlerto worker factoryWorkerFactory: protocol updated withretry_handlerparameterFileConfig: removed unusedmax_retriesfieldtests/integration/test_retry.py07_retry_handling.pydemonstrating retry patterns