Repository navigation
feat: retry unprocessed requests in batch_add_requests - #1244
Open
cobanfurkanx wants to merge 1 commit into
Open
cobanfurkanx wants to merge 1 commit into
cobanfurkanx wants to merge 1 commit into
Conversation
This branch has not been deployed
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
DEFAULT_UNPROCESSED_RETRIES_BATCH_ADD_REQUESTS = 3andDEFAULT_MIN_DELAY_BETWEEN_UNPROCESSED_REQUESTS_RETRIES = timedelta(milliseconds=500)insrc/apify_client/_consts.py.RequestQueueClient.batch_add_requests()and asyncRequestQueueClientAsync.batch_add_requests()(along with_batch_add_requests_worker,_serialize_requests,_compute_retry_delay_seconds, and_record_batch_attempt_result) insrc/apify_client/_resource_clients/request_queue.pyto retryunprocessed_requestswith exponential backoff while preserving non-breaking default behavior and recording rate-limit rounds viaself._http_client.stats.add_rate_limit_error(attempt + 1).test_batch_processed_partially_{async,sync}and addtest_batch_add_requests_retries_unprocessed_requests_{async,sync}intests/unit/test_client_request_queue.py.Closes #1134
Verification
pytest tests/unit/test_client_request_queue.py tests/unit/test_statistics.py: 63 passed ([impit]and[httpx2])poe lint(ruff format --check && ruff check): 249 files formatted, all checks passedty check src tests/unit/test_client_request_queue.py&ty check --python-platform linux: all checks passedpoe check-docstrings: async and sync method docstrings are in sync