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

Run immediate tasks in the parent process of the worker #5767

Open
dkliban opened this issue Sep 3, 2024 · 3 comments
Open

Run immediate tasks in the parent process of the worker #5767

dkliban opened this issue Sep 3, 2024 · 3 comments
Assignees
Labels

Comments

@dkliban
Copy link
Member

dkliban commented Sep 3, 2024

Is your feature request related to a problem? Please describe.
Immediate tasks, such as updates of repositories, remotes, and distributions can get stuck behind long running tasks such as syncs and publish.

Describe the solution you'd like
Have the parent process of the worker execute the immediate tasks in the parent process itself when all the resources for the task are available.

@pedro-psb
Copy link
Member

I'm taking this with @mdellweg mentorship

@pedro-psb
Copy link
Member

pedro-psb commented Sep 26, 2024

We designed a plan to implement this in three steps for smoother deliver and feedback cycles:

  1. Prioritize immediate task
  2. Add special handler to immediate task (run in foreground + timeout)
  3. We'll discuss more (can't remember right now 😅 ) [edit mdellweg] Handle the immediate tasks while select-looping to either sleep or supervise a long running task.

@mdellweg
Copy link
Member

  1. Rewrite the pulpcore-worker in python async.
  • We are halfway there already with the select looping, and keeping the heartbeat loop responsive while performing lot's of immediate tasks would be made much easier with proper async.

pedro-psb added a commit to pedro-psb/pulpcore that referenced this issue Sep 27, 2024
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
pedro-psb added a commit to pedro-psb/pulpcore that referenced this issue Sep 27, 2024
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
pedro-psb added a commit to pedro-psb/pulpcore that referenced this issue Sep 30, 2024
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
pedro-psb added a commit to pedro-psb/pulpcore that referenced this issue Oct 2, 2024
* 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
pedro-psb added a commit to pedro-psb/pulpcore that referenced this issue Oct 2, 2024
* 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
pedro-psb added a commit to pedro-psb/pulpcore that referenced this issue Oct 2, 2024
* 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
pedro-psb added a commit to pedro-psb/pulpcore that referenced this issue Oct 2, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants