Project

Profile

Help

Story #3542

As a plugin writer, I can create a task that waits until there are no reservations

Added by daviddavis over 1 year ago. Updated 6 months ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Platform Release:
Blocks Release:
Backwards Incompatible:
No
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

For orphan cleanup, we had to write a task that waits until there's no other reservations and then we execute it. We'd like to make this functionality more generic so that plugin writers can leverage it. Also, using the task's name to see if it's a zero reservation task is brittle.

Currently, we just hardcode the task name to see if it needs no reservations (see the design in #3442).

We need to come up with how the data model looks, the decorators for declaring these tasks, etc.


Related issues

Related to Pulp - Story #3442: As a user, I can clean up both orphaned content units and orphaned artifacts MODIFIED Actions

History

#1 Updated by daviddavis over 1 year ago

  • Related to Story #3442: As a user, I can clean up both orphaned content units and orphaned artifacts added

#2 Updated by daviddavis over 1 year ago

  • Description updated (diff)

#3 Updated by bmbouter over 1 year ago

I think the crux of it is some way for the plugin writer to tell the resource manager to run the task code synchronously at the right time. To facilitate that, we could add a boolean parameter called singleton=False to _queue_reserve_resource. When True instead of dispatching a task it performs the same call workflow as what the orphan cleanup code branches do.

Plugin writer's would need a way to call this easily. We could introduce a new call for them that would be attached onto all PulpTask


def apply_async_singleton(self, args=None, kwargs=None):
    pass # do things similar to apply_async_with_reservation but call _queue_reserve_resource with singleton=True

This puts the caller in charge of saying what type of treatment that task needs.

#4 Updated by bmbouter over 1 year ago

I also don't think this is something we need to fix right away or even soon. We don't have any plugin writer use cases with this type of requirement that I know of.

#5 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF