Skip to content

AsyncDataloader: Rework task waiting#5672

Merged
rmosolgo merged 9 commits into
masterfrom
async-dataloader-error-handling
Jul 21, 2026
Merged

AsyncDataloader: Rework task waiting#5672
rmosolgo merged 9 commits into
masterfrom
async-dataloader-error-handling

Conversation

@rmosolgo

@rmosolgo rmosolgo commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Trying to fix #5671

The previous control flow around paused tasks was very clunky. This PR streamlines it by replacing the started_ and finished_ queues with a single queue that receives status updates from running tasks.

As a result, it's very easy to keep a set of currently-running tasks, and then to know when they're done.

This change also makes the Run itself aware of whether its parent Dataloader still has unscheduled work. This allows me to properly distinguish between two different conditions:

  1. Previously-started tasks have all either completed or paused, so try starting more tasks if there's bandwidth
  2. All tasks have paused, and either the work is finished or there's no more bandwidth, so move on to the next phase

Those checks were mixed together previously, leading to ... bugs ..?

@rmosolgo rmosolgo changed the title AsyncDataloader: Rescue all errors before they reach Async AsyncDataloader: Rework task waiting Jul 17, 2026
@rmosolgo rmosolgo added this to the 2.6.6 milestone Jul 21, 2026
@rmosolgo
rmosolgo merged commit dd6f3f3 into master Jul 21, 2026
13 checks passed
@rmosolgo
rmosolgo deleted the async-dataloader-error-handling branch July 21, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AsyncDataloader: ClosedQueueError persists in 2.6.5 and can hang requests indefinitely (follow-up to #5654)

1 participant