Skip to content

Transactional inconsistency in connector after OCA/queue#881 removal of implicit commit #522

@juliocabrerizo

Description

@juliocabrerizo

Module

connector

Describe the bug

After the changes introduced in OCA/queue#881 in
OCA/queue (removal of the implicit commit before job execution),
we have detected a transactional inconsistency in the connector framework.

In the export flow, the synchronizer still performs an explicit:

self.env.cr.commit()

inside:
connector/components/synchronizer.py (line ~166)

Now that queue_job no longer commits before executing the job logic,
this explicit commit breaks the job execution.

If a failure occurs later in the same job execution, the binding
(external_id, sync_date, etc.) may already be committed while the job itself
is marked as failed.

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. Execute any export using a connector GenericExporter.
  2. Ensure that the export logic reaches the explicit self.env.cr.commit().
  3. Raise an exception later in the same job execution flow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions