Skip to content

fix(storages): Set handled_at only after the request queue marks the request - #2580

Open
Mantisus wants to merge 1 commit into
apify:v2from
Mantisus:request-queue-handled-at
Open

Mantisus wants to merge 1 commit into
apify:v2from
Mantisus:request-queue-handled-at

Conversation

@Mantisus

@Mantisus Mantisus commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Description

RequestQueue.mark_request_as_handled now passes the storage backend a copy of the request and sets handled_at on the given request only once the backend has marked it. A mark that fails or is cancelled midway no longer leaves the request looking handled, so a caller that checks was_already_handled, such as the crawler, can still give it back to the queue.

RedisStorageBackend no longer makes its own copy for the same purpose. MemoryStorageBackend now stores the copy of a handled request, not the given object.

Testing

  • New and extended unit tests for RequestQueue, run on every storage backend.

✍️ Drafted by Claude Code

@Mantisus Mantisus self-assigned this Dec 3, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant