Project

Profile

Help

Issue #3056

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

Added by dkliban@redhat.com about 2 years ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
3. High
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 26

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!

Associated revisions

Revision 352caddd View on GitHub
Added by dalley about 2 years ago

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

Revision 352caddd View on GitHub
Added by dalley about 2 years ago

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

Revision 352caddd View on GitHub
Added by dalley about 2 years ago

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

History

#1 Updated by ttereshc about 2 years ago

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

#2 Updated by mhrivnak about 2 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.

#3 Updated by ttereshc about 2 years ago

  • Triaged changed from No to Yes

#4 Updated by dalley about 2 years ago

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

#5 Updated by dalley about 2 years ago

  • Status changed from ASSIGNED to POST

#6 Updated by dalley about 2 years ago

  • Status changed from POST to MODIFIED

#7 Updated by bmbouter over 1 year ago

  • Sprint set to Sprint 26

#8 Updated by bmbouter over 1 year ago

  • Sprint/Milestone deleted (45)

#9 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#10 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF