Project

Profile

Help

Story #3542

closed

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

Added by daviddavis over 6 years ago. Updated over 4 years ago.

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

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

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 artifactsCLOSED - CURRENTRELEASEdaviddavis

Actions
Actions #1

Updated by daviddavis over 6 years ago

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

Updated by daviddavis over 6 years ago

  • Description updated (diff)
Actions #3

Updated by bmbouter over 6 years 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.

Actions #4

Updated by bmbouter over 6 years 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.

Actions #5

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)
Actions #6

Updated by daviddavis over 4 years ago

  • Status changed from NEW to CLOSED - CURRENTRELEASE
Actions #7

Updated by daviddavis over 4 years ago

  • Status changed from CLOSED - CURRENTRELEASE to CLOSED - WONTFIX

Also available in: Atom PDF