Actions
Issue #8987
closedGraceful shutdown of a worker processing a task does not cancel the task
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 100
Quarter:
Description
To reproduce¶
- Have pulpcore==3.14 with the new-style tasking system and pulp_file
- Add a sleep(60) statement to the sync task for pulp_file
- Start the api and content app, I used
sudo systemctl start pulpcore-content pulpcore-api
- Start the pulpcore-worker interactively using
pulpcore-worker
- Start a sync and watch it take a while on the sync due to the sleep(60)
- Send one Ctrl-C
- Observe the log statements that show waiting for the task and eventually it aborts and exits
- Look at the task state for that task, observe even after exit it's at running
- Start pulpcore-worker again
- Look at the task state again, and notice it's cancelled now
Expected behavior¶
I expected the task state of graceful shutdown tasks to be at cancelled without another worker "fixing" the state. This is not a serious issue to me, but it's different than I expected. So to me, step (8) should show cancelled.
Actions
Attempt to cancel aborted tasks on worker shutdown
fixes #8987 https://pulp.plan.io/issues/8987