Project

Profile

Help

Issue #3056

closed

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

Added by dkliban@redhat.com about 7 years ago. Updated almost 5 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 about 7 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 about 7 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 about 7 years ago

  • Triaged changed from No to Yes
Actions #4

Updated by dalley about 7 years ago

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

Added by dalley about 7 years ago

Revision 352caddd | View on GitHub

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 about 7 years ago

Revision 352caddd | View on GitHub

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 about 7 years ago

  • Status changed from ASSIGNED to POST
Actions #6

Updated by dalley about 7 years ago

  • Status changed from POST to MODIFIED
Actions #7

Updated by bmbouter over 6 years ago

  • Sprint set to Sprint 26
Actions #8

Updated by bmbouter over 6 years ago

  • Sprint/Milestone deleted (45)
Actions #9

Updated by daviddavis over 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #10

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)
Actions #11

Updated by bmbouter almost 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF