It's possible to kill pulp-workers so hard that they disappear without being able to clean up. In this case, Pulp thinks they're still around.
This can cause several problems. Symptoms include:
Debugging what exactly is going on can be hard. This doc is a braindump of commands we've used to investigate when things go Awry.
Tools used in the sample commands below include:
pulp
commandhttp
commandjq
for massaging json outputrq
for Querying the RQ Queuespulpcore-manager
for gathering data directly from Django without having to crawl inside the database
sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' pulpcore-manager
The following will tell you if you have a zombie worker holding a resource:
Example output when Something Is Wrong:
To clean up the locked ReservedResource and clean up the zombie, you can use this:
Output:
pulp task list --state=waiting | jq length
http :/pulp/api/v3/tasks/?state=waiting | jq '.count'
pulp task list --state=running | jq length
http :/pulp/api/v3/tasks/?state=running | jq '.count'
pulp task list --state=failed | jq length
http :/pulp/api/v3/tasks/?state=failed | jq '.count'
rq info
rq info -u redis://localhost:6379/8
rq empty -a
sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' \ DJANGO_SETTINGS_MODULE='pulpcore.app.settings' \ pulpcore-manager shell -c "from pulpcore.app.models import Worker; print(Worker.objects.online_workers())"
pulp status | jq '.online_workers | .[] | {name, pulp_href}'
pulpcore-manager shell -c "from pulpcore.app.models import ReservedResource; print(ReservedResource.objects.all())"
pulpcore-manager shell -c "from pulpcore.app.models import ReservedResource; print(ReservedResource.objects.get(pk='9762ffab-a473-42b5-85af-5150f3673812').__dict__)"
pulpcore-manager shell -c "from pulpcore.app.models import ReservedResource; print(ReservedResource.objects.get(pk='9762ffab-a473-42b5-85af-5150f3673812').worker)"
pulpcore-manager shell -c "from pulpcore.app.models import ReservedResource; ReservedResource.objects.get(pk='9762ffab-a473-42b5-85af-5150f3673812').delete()"
pulpcore-manager shell -c "from pulpcore.app.models import Worker; w=Worker.objects.get(name='worker@pulp-worker-5976996b5d-r5hwc'); w.cleaned_up=True; w.save()