Project

Profile

Help

Issue #3817

closed

Task assigned to the resource manager not cancel when it stops

Added by hyu over 5 years ago. Updated almost 5 years ago.

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

Description

When stopping resource manager worker, tasks that assigned to the resource manager will not be cancelled and leaving the tasks in "Waiting" state forever. This is because the "worker_name" of the TaskStatus is not set during the creation and Pulp is unable to find the tasks for the resource manager during the worker cleanup.

Below is how I reproduce it.
1) Stop the all pulp workers and leave only pulp resource manager running.
2) Trigger a regenerate applicability for consumers task
3) Check the Qpid stat and I saw 1 message.

  1. qpid-stat -q -b amqps://localhost:5671
    Queues
    queue dur autoDel excl msg msgIn msgOut bytes bytesIn bytesOut cons bind
    ==================================================================================================================================================
    resource_manager Y 1 1 0 1.36k 1.36k 0 1 2

4) Stop resource manager. 'systemctl stop pulp_resource_manager' and I saw the message is dequeued
Queues
queue dur autoDel excl msg msgIn msgOut bytes bytesIn bytesOut cons bind
================================================================================================================================
resource_manager Y 0 1 1 0 1.36k 1.36k 0 2

5) Check the task and I saw the task is still in "Waiting" state.

pulp_tasks:
- exception:
task_type: pulp.server.managers.consumer.applicability.regenerate_applicability_for_consumers
_href: "/pulp/api/v2/tasks/7885eaad-7563-4814-981a-b6e23cf459c4/"
task_id: 7885eaad-7563-4814-981a-b6e23cf459c4
tags:
- pulp:action:consumer_content_applicability_regeneration
finish_time:
_ns: task_status
start_time:
traceback:
spawned_tasks: []
progress_report: {}
queue: None.dq
state: waiting
worker_name:

Also available in: Atom PDF