Actions
Issue #3056
closedrapidly dispatching sync of the same repo causes resource manager to print traceback
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 26
Quarter:
Description
http POST http://127.0.0.1:8000/api/v3/repositories/ name=example-repo notes:={} scratchpad:={}
http POST http://127.0.0.1:8000/api/v3/repositories/example-repo/importers/example-asyncio/ name=example-importer download_policy='immediate' repository='http://127.0.0.1:800/api/v3/repositories/example-repo/' feed_url='https://repos.fedorapeople.org/pulp/pulp/fixtures/file-mixed/PULP_MANIFEST' sync_mode='mirror'
http POST http://127.0.0.1:8000/api/v3/repositories/example-repo/importers/example-asyncio/example-importer/sync/
http POST http://127.0.0.1:8000/api/v3/repositories/example-repo/importers/example-asyncio/example-importer/sync/
http POST http://127.0.0.1:8000/api/v3/repositories/example-repo/importers/example-asyncio/example-importer/sync/
http POST http://127.0.0.1:8000/api/v3/repositories/example-repo/importers/example-asyncio/example-importer/sync/
The following shows up in the logs:
Task pulpcore.tasking.tasks._queue_reserved_task[c1c4b1c1-da9d-4c09-9bd0-d8c2f57bd5a5] raised unexpected: MultipleObjectsReturned('get() returned more than one ReservedResource -- it returned 2!',)
Traceback (most recent call last):
File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/celery/app/trace.py", line 374, in trace_task
R = retval = fun(*args, **kwargs)
File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/celery/app/trace.py", line 629, in __protected_call__
return self.run(*args, **kwargs)
File "/home/vagrant/devel/pulp/platform/pulpcore/tasking/tasks.py", line 75, in _queue_reserved_task
worker = ReservedResource.objects.get(resource=resource_id).worker
File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/db/models/query.py", line 384, in get
(self.model._meta.object_name, num)
pulpcore.app.models.task.MultipleObjectsReturned: get() returned more than one ReservedResource -- it returned 2!
Actions
Fix traceback on rapid dispatch of multiple syncs
We need to be using a queryset for ReservedResources, not "get()".
closes #3056 https://pulp.plan.io/issues/3056