Skip to content

fix: Preserve forefront flag on RequestQueue retry path#1861

Merged
vdusek merged 1 commit intomasterfrom
fix/forefront-retry-in-request-queue
Apr 27, 2026
Merged

fix: Preserve forefront flag on RequestQueue retry path#1861
vdusek merged 1 commit intomasterfrom
fix/forefront-retry-in-request-queue

Conversation

@vdusek
Copy link
Copy Markdown
Collaborator

@vdusek vdusek commented Apr 27, 2026

Description

RequestQueue._process_batch accepts a forefront flag and forwards it on the first attempt to add_batch_of_requests. When the storage client returned unprocessed requests, the recursive retry call omitted forefront, so it fell back to the parameter default False regardless of what the original caller asked for.

A user calling add_requests(..., forefront=True) would silently see requests appended to the back of the queue whenever they happened to be in an unprocessed_requests response, breaking the priority-ordering guarantee.

Fix

Forward forefront=forefront in the recursive _process_batch call.

Test

Added a regression test (parametrized over True and False) that mocks add_batch_of_requests to return all requests as unprocessed on the first call and asserts the retry uses the same forefront value as the original call.

When `add_batch_of_requests` returned unprocessed requests, the recursive
`_process_batch` retry dropped the `forefront` kwarg and fell back to the
default `False`, silently re-inserting requests at the back of the queue
and breaking the priority-ordering guarantee.
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Apr 27, 2026
@vdusek vdusek self-assigned this Apr 27, 2026
@vdusek vdusek requested a review from Pijukatel April 27, 2026 10:48
@github-actions github-actions Bot added this to the 139th sprint - Tooling team milestone Apr 27, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Apr 27, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.42%. Comparing base (3c594fe) to head (68df76c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1861   +/-   ##
=======================================
  Coverage   92.41%   92.42%           
=======================================
  Files         158      158           
  Lines       11009    11009           
=======================================
+ Hits        10174    10175    +1     
+ Misses        835      834    -1     
Flag Coverage Δ
unit 92.42% <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.

Copy link
Copy Markdown
Collaborator

@Mantisus Mantisus left a comment

Choose a reason for hiding this comment

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

LGTM

@vdusek vdusek merged commit dc1073a into master Apr 27, 2026
32 checks passed
@vdusek vdusek deleted the fix/forefront-retry-in-request-queue branch April 27, 2026 16:00
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. 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.

3 participants