fix: keep non-forefront reclaimed requests pending in the single request queue client - #1060
Open
vdusek wants to merge 3 commits into
Open
fix: keep non-forefront reclaimed requests pending in the single request queue client#1060vdusek wants to merge 3 commits into
vdusek wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1060 +/- ##
==========================================
+ Coverage 92.31% 92.37% +0.06%
==========================================
Files 51 51
Lines 3317 3318 +1
==========================================
+ Hits 3062 3065 +3
+ Misses 255 253 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
force-pushed
the
worktree-fix-b1
branch
from
August 21, 2026 11:34
0136f4a to
3d4e881
Compare
…e request queue client
vdusek
marked this pull request as ready for review
August 21, 2026 12:31
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.
reclaim_request(forefront=False)in the single-mode request queue client discarded the request id from_requests_in_progressand re-cached it, but never re-entered it into_head_requests— the only structureis_empty()andis_finished()read. Once the platform head listing lagged behind the reclaim, both reported the queue finished,AutoscaledPoolshut the run down, and the request stayed pending forever while the run reportedSUCCEEDED. This is crawlee's ordinary retry path, so any transient request failure near queue exhaustion could silently drop work.The fix mirrors what
add_batch_of_requestsalready does for non-forefront adds:_head_requests.appendleft(request_id). Theforefront=Truebranch is unchanged. No duplicate risk —_list_headskips ids already in the head, and every crawlee reclaim site operates on a request this client had already popped out of the head.A regression test, parametrized over
forefront, fetches a request through the real path, reclaims it whilelist_headkeeps listing empty, and assertsis_empty()/is_finished()stayFalseand the request is handed out again. Thedefaultcase fails without the fix;forefrontpassed before and after.Scoped down from the original version of this PR: the shared-client half was made redundant by #1087, and the integration test it added covered the forefront path, which was never broken.
✍️ Drafted by Claude Code