Skip to content

Fix RedisWorker stalling when >20 tasks wait on same resource#7615

Merged
dkliban merged 3 commits intopulp:mainfrom
dkliban:fix/redis-worker-fetch-limit
Apr 22, 2026
Merged

Fix RedisWorker stalling when >20 tasks wait on same resource#7615
dkliban merged 3 commits intopulp:mainfrom
dkliban:fix/redis-worker-fetch-limit

Conversation

@dkliban
Copy link
Copy Markdown
Member

@dkliban dkliban commented Apr 20, 2026

Summary

  • When a user dispatches 21+ tasks for the same exclusive resource, fetch_task() now doubles its query limit and retries from the oldest task until a runnable task is found or the entire queue is examined
  • Previously, workers only looked at the 20 oldest tasks — if all were blocked on the same resource, tasks at position 21+ (which may use different resources) were never examined

closes: #7612

Test plan

  • Ran test_tasking.py functional tests in dev container — all tasking-relevant tests pass
  • Ran test_tasks.py (using_plugin) functional tests — all pass
  • Verify with 25+ tasks dispatched for the same repo + 1 task for a different repo: the different-repo task should be picked up promptly

🤖 Generated with Claude Code

dkliban and others added 2 commits April 20, 2026 10:08
When all tasks in the initial fetch batch are blocked on the same
resource, the worker now doubles the fetch limit and re-queries
from the oldest task. This repeats until a runnable task is found
or the entire queue has been examined.

closes: pulp#7612

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verifies that when 25+ tasks are blocked on the same resource,
a task using a different resource at position 27 still gets picked up.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dkliban dkliban force-pushed the fix/redis-worker-fetch-limit branch from 1ffdd45 to d9549cd Compare April 20, 2026 14:29
@dkliban dkliban merged commit 42190f4 into pulp:main Apr 22, 2026
13 of 14 checks passed
@patchback
Copy link
Copy Markdown

patchback Bot commented Apr 22, 2026

Backport to 3.109: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.109/42190f416a70098b410591a884d6d21785da45e3/pr-7615

Backported as #7624

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RedisWorker stops processing tasks when more than 20 tasks are waiting on resources

3 participants