Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasks with resource constraints ignore priority #6137

Closed
crusaderky opened this issue Apr 15, 2022 · 0 comments · Fixed by #6711
Closed

Tasks with resource constraints ignore priority #6137

crusaderky opened this issue Apr 15, 2022 · 0 comments · Fixed by #6711
Assignees

Comments

@crusaderky
Copy link
Collaborator

crusaderky commented Apr 15, 2022

Worker._ensure_computing is implemented as follows:

while self.constrained and there are free threads and there are free resources:
    task = self.constrained.popleft()
    compute(task)
while self.ready and there are free threads:
    _, task = heapq.heappop(self.ready):
    compute(task)

This means that, once tasks with resource constraints land on a worker, they are executed in a strictly FIFO order.
What's more, they are always prepended to tasks without constraints (as long as the worker resource isn't depleted).
Effectively, this is like setting priority=999999 on the client.

Note: I did not analyse the algorithm on the scheduler side. A review is recommended.

Related issues:

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 a pull request may close this issue.

1 participant