Project

Profile

Help

Issue #3056

closed

rapidly dispatching sync of the same repo causes resource manager to print traceback

Added by dkliban@redhat.com over 4 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
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 #1

Updated by ttereshc over 4 years ago

  • Priority changed from Normal to High
  • Sprint/Milestone set to 45
  • Severity changed from 2. Medium to 3. High
Actions #2

Updated by mhrivnak over 4 years ago

The model is missing a uniqueness constraint on "resource". That needs to be added, and then it's worth a quick audit of any code that creates them to make sure it's prepared for a duplicate key error.

Actions #3

Updated by ttereshc over 4 years ago

  • Triaged changed from No to Yes
Actions #4

Updated by dalley over 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley

Added by dalley over 4 years ago

Revision 352caddd

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

Added by dalley over 4 years ago

Revision 352caddd

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

Actions #5

Updated by dalley over 4 years ago

  • Status changed from ASSIGNED to POST
Actions #6

Updated by dalley over 4 years ago

  • Status changed from POST to MODIFIED
Actions #7

Updated by bmbouter over 4 years ago

  • Sprint set to Sprint 26
Actions #8

Updated by bmbouter over 4 years ago

  • Sprint/Milestone deleted (45)
Actions #9

Updated by daviddavis about 3 years ago

  • Sprint/Milestone set to 3.0.0
Actions #10

Updated by bmbouter about 3 years ago

  • Tags deleted (Pulp 3)
Actions #11

Updated by bmbouter over 2 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF