Skip to content

fix: Eliminate race condition in _fetch_requests_from_url#796

Merged
vdusek merged 2 commits intomasterfrom
fix/fetch-requests-from-url-race
Feb 17, 2026
Merged

fix: Eliminate race condition in _fetch_requests_from_url#796
vdusek merged 2 commits intomasterfrom
fix/fetch-requests-from-url-race

Conversation

@vdusek
Copy link
Contributor

@vdusek vdusek commented Feb 16, 2026

Summary

  • _fetch_requests_from_url used add_done_callback + asyncio.create_task to process HTTP responses, but asyncio.gather only awaited the HTTP request tasks — not the callback-spawned processing tasks
  • This caused created_requests to be returned before processing completed, yielding empty or incomplete results
  • Refactored to gather HTTP responses first, then process each response sequentially, ensuring all extracted URLs are collected before returning

Test plan

  • CI passes

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

The previous implementation used `add_done_callback` + `asyncio.create_task`
to process HTTP responses, but `asyncio.gather` only awaited the HTTP request
tasks — not the callback-spawned processing tasks. This caused
`created_requests` to be returned before processing completed, yielding
empty or incomplete results.

Refactored to gather all HTTP responses first, then process each response
sequentially, ensuring all extracted URLs are collected before returning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Feb 16, 2026
@vdusek vdusek self-assigned this Feb 16, 2026
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Feb 16, 2026
@github-actions github-actions bot added this to the 134th sprint - Tooling team milestone Feb 16, 2026
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.54%. Comparing base (252eb4e) to head (807edef).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #796      +/-   ##
==========================================
+ Coverage   85.46%   85.54%   +0.07%     
==========================================
  Files          46       46              
  Lines        2697     2691       -6     
==========================================
- Hits         2305     2302       -3     
+ Misses        392      389       -3     
Flag Coverage Δ
e2e 35.48% <0.00%> (+0.07%) ⬆️
integration 57.63% <0.00%> (+0.16%) ⬆️
unit 72.46% <100.00%> (+0.01%) ⬆️

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.

@vdusek vdusek requested a review from Pijukatel February 16, 2026 17:19
@vdusek vdusek added the bug Something isn't working. label Feb 16, 2026
@vdusek vdusek marked this pull request as ready for review February 16, 2026 17:21
Process all remote URL fetches and their response bodies in parallel
using a single asyncio.gather instead of sequential processing. Refactor
to use @classmethod, inline _create_request_list into open, and extract
_process_remote_url as a static helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vdusek vdusek requested a review from Pijukatel February 17, 2026 11:50
@vdusek vdusek merged commit c0a74b9 into master Feb 17, 2026
31 checks passed
@vdusek vdusek deleted the fix/fetch-requests-from-url-race branch February 17, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. bug Something isn't working. 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.

2 participants