-
-
Notifications
You must be signed in to change notification settings - Fork 748
Open
Labels
testsUnit tests and/or continuous integrationUnit tests and/or continuous integration
Description
Follow-up from #6062
- A task is assigned to a Worker
- The task transitions to ready, thus is pushed into the
Worker.readyheap, or to constrained, thus is pushed into theWorker.constrainedheap - Before it reaches computing state, it is stolen. As there's no way to pop from the middle of a heap, the task stays there.
- The task is assigned to the worker again before
Worker._ensure_computingcould reach its position in the heap - You end up with a duplicate key in the heap.
There's nothing wrong with having a duplicate per se, and Worker._ensure_computing gracefully deals with it; however the use case is far from trivial. At the moment of writing, replacing the graceful handling with a hard assertion of no duplicates only causes very mild flakiness in the most demanding stress tests.
Write a unit test that deterministically triggers the use case both with and without resource constraints.
CC @fjetter
Metadata
Metadata
Assignees
Labels
testsUnit tests and/or continuous integrationUnit tests and/or continuous integration