Skip to content

fix: Fix crawler deadlock when API fails during marking request as handled#768

Merged
Pijukatel merged 5 commits intomasterfrom
fix-rq-state-when-marking-ashandled-fails
Feb 13, 2026
Merged

fix: Fix crawler deadlock when API fails during marking request as handled#768
Pijukatel merged 5 commits intomasterfrom
fix-rq-state-when-marking-ashandled-fails

Conversation

@Pijukatel
Copy link
Contributor

@Pijukatel Pijukatel commented Feb 9, 2026

Description

  • Fix a rare scenario where RequestQueue is in an invalid state due to a failed API call to mark the request as handled. This invalid state can lead to a crawler deadlock.
  • Fixed only for ApifyRequestQueueSingleClient, as for the shared client, it is not possible to distinguish between API failure and external modification of the queue on the platform.

Issues

Testing

  • Added unit test

Checklist

  • CI passed

@github-actions github-actions bot added this to the 134th sprint - Tooling team milestone Feb 9, 2026
@github-actions github-actions bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Feb 9, 2026
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.98%. Comparing base (a814c63) to head (b6f5284).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...age_clients/_apify/_request_queue_shared_client.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #768      +/-   ##
==========================================
+ Coverage   81.86%   81.98%   +0.12%     
==========================================
  Files          46       46              
  Lines        2696     2698       +2     
==========================================
+ Hits         2207     2212       +5     
+ Misses        489      486       -3     
Flag Coverage Δ
e2e 43.47% <0.00%> (-0.04%) ⬇️
integration 55.67% <88.88%> (+0.21%) ⬆️
unit 67.90% <0.00%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Pijukatel Pijukatel force-pushed the fix-rq-state-when-marking-ashandled-fails branch from 55bc2a2 to b4bed05 Compare February 9, 2026 10:42
@Pijukatel Pijukatel force-pushed the fix-rq-state-when-marking-ashandled-fails branch from b4bed05 to 6db57ef Compare February 10, 2026 08:27
@Pijukatel Pijukatel force-pushed the fix-rq-state-when-marking-ashandled-fails branch from 6db57ef to 425093b Compare February 10, 2026 09:39
@Pijukatel Pijukatel requested a review from vdusek February 13, 2026 08:17
@Pijukatel Pijukatel marked this pull request as ready for review February 13, 2026 08:17
@Pijukatel Pijukatel force-pushed the fix-rq-state-when-marking-ashandled-fails branch from 438e556 to 103474d Compare February 13, 2026 08:41
Copy link
Contributor

@vdusek vdusek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One potential misleading docstring. Otherwise, LGTM.

@Pijukatel Pijukatel merged commit 66ed5ea into master Feb 13, 2026
31 checks passed
@Pijukatel Pijukatel deleted the fix-rq-state-when-marking-ashandled-fails branch February 13, 2026 15:00
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. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix rare case when crawler can get deadlocked

2 participants