Project

Profile

Help

Issue #4032

closed

spawned_tasks does not work post RQ port

Added by bmbouter over 5 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 43
Quarter:

Description

Problem

Say a plugin writer defines two RQ tasks to be scheduled using the Pulp3 dispatch method enqueue_with_reservation. for example:

def one():
  # assume this is task ID 12345....
  enqueue_with_reservation(two, [])  # the [] is  required part of enqueue_with_reservation, but unrelated to this problem

def two():
  # assume task ID 6789.....
  pass

As a user, I expect that because the plugin writer dispatched task 6789.... from inside task 12345.... that when listing the task details of 12345.... that I would see:

"spawned_tasks": ["/pulp/api/v3/tasks/6789....."]

Instead I see:

"spawned_tasks": []

Root Cause

The issue is that the enqueue_with_reservation code doesn't check if it's running inside a task, and if so, save the new task as a foreign key from this Task.

Also available in: Atom PDF