Project

Profile

Help

Task #5710

closed

Remove `spawned_tasks` and `parent` from task status

Added by bmbouter about 5 years ago. Updated almost 5 years ago.

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

100%

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

Description

Currently our tasks API looks like this:

{
    "created_resources": [
        "/pulp/api/v3/repositories/file/file/91c84141-aca6-4941-a94d-d8a269271e43/versions/1/"
    ],  
    "error": null,
    "finished_at": "2019-11-13T16:21:27.931150Z",
    "name": "pulpcore.app.tasks.repository.add_and_remove",
    "parent": null,
    "progress_reports": [],
    "pulp_created": "2019-11-13T16:21:27.772294Z",
    "pulp_href": "/pulp/api/v3/tasks/e067ae33-5dc7-40f8-89d7-66084a8f3928/",
    "reserved_resources_record": [
        "/pulp/api/v3/repositories/file/file/91c84141-aca6-4941-a94d-d8a269271e43/"
    ],  
    "spawned_tasks": [],
    "started_at": "2019-11-13T16:21:27.872490Z",
    "state": "completed",
    "worker": "/pulp/api/v3/workers/69b13d1f-0f69-4019-aa9a-54cd3eee55b3/"
}

I think we should remove this for now for a few reasons:

  • There are no known use cases for tasks to spawn additional tasks.
  • To my knowledge there are no users using it.
  • To my knowledge, there are no tests testing it.
  • It's a possible deadlocking hazard for tasks to dispatch tasks and we don't have docs guiding plugin writers on how to avoid this.

Solution

  • Remove "spawned_tasks" and "parent" from 3.0 and the "auto-dispatch" machinery that sets it.

Also available in: Atom PDF