Project

Profile

Help

Issue #7560

closed

Import tests are failing with psycopg2.extensions.TransactionRollbackError: deadlock detected

Added by ttereshc about 4 years ago. Updated over 3 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

=================================== FAILURES ===================================
[31m[1m____________________ PulpImportTestCase.test_double_import _____________________[0m

self = <pulp_rpm.tests.functional.api.test_pulpimport.PulpImportTestCase testMethod=test_double_import>

    def test_double_import(self):
        """Test two imports of our export."""
        importer = self._create_importer()
        self._perform_import(importer)
>       self._perform_import(importer)

[1m[31mpulp_rpm/tests/functional/api/test_pulpimport.py[0m:217: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[1m[31mpulp_rpm/tests/functional/api/test_pulpimport.py[0m:174: in _perform_import
    task_group = monitor_task_group(task_group_href)
[1m[31m../pulpcore/pulpcore/tests/functional/utils.py[0m:53: in monitor_task_group
    exit()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = Use exit() or Ctrl-D (i.e. EOF) to exit, code = None

    def __call__(self, code=None):
        # Shells like IDLE catch the SystemExit, but listen when their
        # stdin wrapper is closed.
        try:
            sys.stdin.close()
        except:
            pass
>       raise SystemExit(code)
[1m[31mE       SystemExit: None[0m

[1m[31m../../../virtualenv/python3.7.6/lib/python3.7/site.py[0m:403: SystemExit
----------------------------- Captured stdout call -----------------------------
The task group was successful.
The task group failed: {'all_tasks_dispatched': True,
 'canceled': 0,
 'completed': 1,
 'description': 'Import of '
                '/tmp/4a764f1a-8d20-4c62-b4b0-f30c7dfa885f/export-6a6d7142-27d0-4254-803b-c130a5cc8226-20200923_1810.tar.gz',
 'failed': 1,
 'group_progress_reports': [],
 'pulp_href': '/pulp/api/v3/task-groups/36850d31-1741-4a4f-94ef-9444079a46e7/',
 'running': 0,
 'skipped': 0,
 'waiting': 0}
[31m[1m________________________ PulpImportTestCase.test_import ________________________[0m

self = <pulp_rpm.tests.functional.api.test_pulpimport.PulpImportTestCase testMethod=test_import>

    def test_import(self):
        """Test an import."""
        importer = self._create_importer()
>       task_group = self._perform_import(importer)

[1m[31mpulp_rpm/tests/functional/api/test_pulpimport.py[0m:207: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[1m[31mpulp_rpm/tests/functional/api/test_pulpimport.py[0m:174: in _perform_import
    task_group = monitor_task_group(task_group_href)
[1m[31m../pulpcore/pulpcore/tests/functional/utils.py[0m:53: in monitor_task_group
    exit()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = Use exit() or Ctrl-D (i.e. EOF) to exit, code = None

    def __call__(self, code=None):
        # Shells like IDLE catch the SystemExit, but listen when their
        # stdin wrapper is closed.
        try:
            sys.stdin.close()
        except:
            pass
>       raise SystemExit(code)
[1m[31mE       SystemExit: None[0m

[1m[31m../../../virtualenv/python3.7.6/lib/python3.7/site.py[0m:403: SystemExit
----------------------------- Captured stdout call -----------------------------
The task group failed: {'all_tasks_dispatched': True,
 'canceled': 0,
 'completed': 1,
 'description': 'Import of '
                '/tmp/4a764f1a-8d20-4c62-b4b0-f30c7dfa885f/export-6a6d7142-27d0-4254-803b-c130a5cc8226-20200923_1810.tar.gz',
 'failed': 1,
 'group_progress_reports': [],
 'pulp_href': '/pulp/api/v3/task-groups/6309e8b8-ad86-4952-af6b-4407869fada6/',
 'running': 0,
 'skipped': 0,
 'waiting': 0}
pulp: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpmg86kb9w/repository-2e2d61c9-92b9-4f62-b671-c5dc76c0c787_1/pulp_rpm.app.modelresource.ModulemdResource.json.
pulp: pulpcore.app.tasks.importer:INFO: ...Importing resource ModulemdResource.
pulp: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpmg86kb9w/repository-2e2d61c9-92b9-4f62-b671-c5dc76c0c787_1/pulp_rpm.app.modelresource.ModulemdDefaultsResource.json.
pulp: pulpcore.app.tasks.importer:INFO: ...Importing resource ModulemdDefaultsResource.
pulp: pulpcore.app.tasks.importer:INFO: Importing file /tmp/tmpmg86kb9w/repository-2e2d61c9-92b9-4f62-b671-c5dc76c0c787_1/pulp_rpm.app.modelresource.PackageGroupResource.json.
pulp: pulpcore.app.tasks.importer:INFO: ...Importing resource PackageGroupResource.
pulp: rq.worker:ERROR: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
psycopg2.extensions.TransactionRollbackError: deadlock detected
DETAIL:  Process 5936 waits for ShareLock on transaction 12280; blocked by process 5925.
Process 5925 waits for ShareLock on transaction 12304; blocked by process 5936.
HINT:  See server log for query details.
CONTEXT:  while updating tuple (3,84) in relation "core_content"
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/rq/worker.py", line 936, in perform_job
    rv = job.perform()
  File "/usr/local/lib/python3.7/site-packages/rq/job.py", line 684, in perform
    self._result = self._execute()
  File "/usr/local/lib/python3.7/site-packages/rq/job.py", line 690, in _execute
    return self.func(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/pulpcore/app/tasks/importer.py", line 150, in import_repository_version
    a_result = _import_file(os.path.join(rv_path, filename), res_class)
  File "/usr/local/lib/python3.7/site-packages/pulpcore/app/tasks/importer.py", line 61, in _import_file
    return resource.import_data(data, raise_errors=True)
  File "/usr/local/lib/python3.7/site-packages/import_export/resources.py", line 745, in import_data
    return self.import_data_inner(dataset, dry_run, raise_errors, using_transactions, collect_failed_rows, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/import_export/resources.py", line 792, in import_data_inner
    raise row_result.errors[-1].error
  File "/usr/local/lib/python3.7/site-packages/import_export/resources.py", line 672, in import_row
    self.save_instance(instance, using_transactions, dry_run)
  File "/usr/local/lib/python3.7/site-packages/import_export/resources.py", line 450, in save_instance
    instance.save()
  File "/usr/local/lib/python3.7/site-packages/pulpcore/app/models/base.py", line 115, in save
    return super().save(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/django_lifecycle/mixins.py", line 128, in save
    save(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py", line 744, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py", line 779, in save_base
    parent_inserted = self._save_parents(cls, using, update_fields)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py", line 810, in _save_parents
    force_insert=parent_inserted,
  File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py", line 854, in _save_table
    forced_update)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/base.py", line 903, in _do_update
    return filtered._update(values) > 0
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 760, in _update
    return query.get_compiler(self.db).execute_sql(CURSOR)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1471, in execute_sql
    cursor = super().execute_sql(result_type)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.7/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.OperationalError: deadlock detected

Full log is attached.


Files

travis-import-deadlock.log (957 KB) travis-import-deadlock.log log from travis ttereshc, 09/23/2020 08:51 PM

Related issues

Related to Pulp - Issue #7073: import test fails with psycopg2.extensions.TransactionRollbackError: deadlock detectedCLOSED - CURRENTRELEASEggaineyActions
Related to RPM Support - Issue #7904: PulpImport can deadlock when importing Centos*-base and app-stream in one import fileCLOSED - CURRENTRELEASEggaineyActions
Actions #1

Updated by ttereshc about 4 years ago

  • Related to Issue #7073: import test fails with psycopg2.extensions.TransactionRollbackError: deadlock detected added
Actions #2

Updated by ttereshc about 4 years ago

  • Subject changed from Import/export tests are failing with psycopg2.extensions.TransactionRollbackError: deadlock detected to Import tests are failing with psycopg2.extensions.TransactionRollbackError: deadlock detected
Actions #3

Updated by ttereshc about 4 years ago

  • Triaged changed from No to Yes
Actions #4

Updated by daviddavis almost 4 years ago

  • Related to Issue #7904: PulpImport can deadlock when importing Centos*-base and app-stream in one import file added
Actions #5

Updated by ggainey over 3 years ago

  • Status changed from NEW to CLOSED - DUPLICATE

Fixed by #7904.

Also available in: Atom PDF