-
Notifications
You must be signed in to change notification settings - Fork 113
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.
9ab7302
to
589053b
Compare
(there is a refator and a impl commit) |
589053b
to
b417979
Compare
Curious how the tests passed on the lowerbound but got stuck in the others scenarios 🤔 |
ce087b4
to
ff396e0
Compare
ff396e0
to
40fd2a0
Compare
d710146
to
697f97a
Compare
* immediate prioritization This defines tasks of the type "immediate" by adding a Task.immediate(bool) field to the Task model. These type of task are ordered first in the worker's query to pick up a new available task. * misc This also adds a "deferred" field to the Task model, so we can later harden the constraint that 'deferred == False' and immediate == True' shouldn't get past the API level. This is possible today in some edge case failure scenarios on dispatch. Closes pulp#5767
697f97a
to
ef6ddb0
Compare
Ready to review. |
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.