Project

Profile

Help

Issue #4032

spawned_tasks does not work post RQ port

Added by bmbouter about 1 year ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 43

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.

Associated revisions

Revision ef4793d9 View on GitHub
Added by bmbouter about 1 year ago

Fixes spawned_tasks and parent

The enqueue_with_reservation method needs to be task-aware such that it
saves the `parent` FK relationship when a task is being dispatched
within a task.

https://pulp.plan.io/issues/4032
closes #4032

Revision ef4793d9 View on GitHub
Added by bmbouter about 1 year ago

Fixes spawned_tasks and parent

The enqueue_with_reservation method needs to be task-aware such that it
saves the `parent` FK relationship when a task is being dispatched
within a task.

https://pulp.plan.io/issues/4032
closes #4032

Revision ef4793d9 View on GitHub
Added by bmbouter about 1 year ago

Fixes spawned_tasks and parent

The enqueue_with_reservation method needs to be task-aware such that it
saves the `parent` FK relationship when a task is being dispatched
within a task.

https://pulp.plan.io/issues/4032
closes #4032

History

#1 Updated by bmbouter about 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to bmbouter
  • Sprint set to Sprint 43

This is a blocker for pulp_ansible work that is trying to use this two-task design for its import process. Adding to sprint to unblock that work after talking on irc w/ @daviddavis.

#2 Updated by bmbouter about 1 year ago

  • Status changed from ASSIGNED to POST

#3 Updated by bmbouter about 1 year ago

  • Status changed from POST to MODIFIED

#4 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#5 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF