-
Notifications
You must be signed in to change notification settings - Fork 112
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
Improve throughput for immediate tasks (1/3) #5841
base: main
Are you sure you want to change the base?
Conversation
7fb9d32
to
d18b071
Compare
pulpcore/tasking/worker.py
Outdated
.first() | ||
) | ||
with contextlib.suppress(AdvisoryLockError), task: | ||
task.refresh_from_db() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.first()
can return None
. Will this not error trying to call a method on None
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, nice catch.
But anyway, this was a sketch of the approach I had in mind, which won't be used.
I force pushed with the ideas I discussed with @mdellweg yesterday.
* Refatored handle_available_tasks for more clarity of the flow * Refactored iter_tasks for more flow clarity and to prepare prioritizaton of immediate tasks. * Added/changed misc comments, docstrings and names
d18b071
to
9ab7302
Compare
This defines tasks of the type "immediate" by adding a Task.immediate(bool) field to the Task model. Non-immediate are called "long". Then, these type of task is put in front of the line when the worker queries for new available tasks. Closes pulp#5767
9ab7302
to
589053b
Compare
(there is a refator and a impl commit) |
In busy tasking environments, "immediate" running tasks (which are only dispatched to workers due to resource locking requirements) can wait for very long behind long-running tasks, such as syncs and publishes.
This tries to solve this implementing the solution proposed in #5767, as discussed in the Pulp team.