Project

Profile

Help

Issue #8988

closed

`pulpcore-worker` startup should remove old worker records

Added by bmbouter over 2 years ago. Updated over 2 years ago.

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

Description

To reproduce

  1. Start a pulpcore-worker against an empty database
  2. Observe that the status API shows that worker
  3. kill -9 your worker
  4. Observe the status API after 30 seconds no longer shows your worker
  5. Start your pulpcore-worker again
  6. Go into shell_plus and observe this query shows 2 workers present: Workers.objects.count()

Expected result

In [1]: Worker.objects.count()
Out[1]: 1

Solution

Have workers that startup run a query that delete any workers that haven't issued a heartbeat in say 7 days. This does not need to be configurable. The 7 day idea is to make something that won't let records accumulate on the long term, but leave them in place for someone to look at the db post-mortem and still see them for investigation.

Also available in: Atom PDF