-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Context
Discovered during review of PR #803 (discussion).
The test_request_reclaim_functionality[shared] integration test is flaky because fetch_next_request() does not immediately return requests that were just added or reclaimed when using the shared request queue access mode. In the single mode, requests are added directly to the local queue_head deque and are available right away, but the shared client cannot do that.
Problem
When using shared request queue mode, there is a propagation delay between:
- Adding a request (or reclaiming one) via the API
- That request becoming visible in
fetch_next_request()
This means users of the shared request queue mode may call fetch_next_request() and get None even though a request was just added or reclaimed.
Expected behavior
fetch_next_request() should reliably return requests that have been added or reclaimed, even in shared mode, without requiring the caller to implement their own retry/polling logic.
Current workaround
Callers need to poll fetch_next_request() with retries and delays to handle the propagation delay.