Skip to content

queue_job: concurrent update exception on job state update #855

Closed as not planned

Description

@gurneyalex

On a production instance, I sometimes experience concurrent update exceptions on setting a job to done. This happens for a job which is part of group of N1 jobs, chained with a single job, chained with a second group of N2 jobs.and that job is always the last job of the first group. The jobs of the first and second group are run in parallel.

The exception I get:

ERROR odoodb odoo.sql_db: bad query: b' UPDATE "queue_job"
                    SET "date_done" = "__tmp"."date_done"::timestamp, "dependencies" = "__tmp"."dependencies"::text, "exec_time" = "__tmp"."exec_time"::double precision, "result" = "__tmp"."result"::text, "retry" = "__tmp"."retry"::int4, "state" = "__tmp"."state"::VARCHAR
                   FROM (VALUES (274978316, \'2025-12-01 15:48:53.476526\', \'{"depends_on": [], "reverse_depends_on": ["abca0f33-26d2-408d-ae2a-f35f62c12844"]}\', 930.537869, NULL, 3, \'done\')) AS "__tmp"("id", "date_done", "dependencies", "exec_time", "result", "retry", "state")
                    WHERE "queue_job"."id" = "__tmp"."id"
               '
ERROR: could not serialize access due to concurrent update

In this case the abca0f33-26d2-408d-ae2a-f35f62c12844 UUID is the UUID of the single job in the middle of the dependency chain, and 274978316 is the ID of the last job to run in the first group.

This happens on a database running Odoo 18.0, the source code of OCA/queue is up to date.

When I get there, the job restarts. If I stop the instance and restart it, the job finally terminates.

Activity

  1. sbidoul commented on Jan 2, 2026

    @sbidoul
    Member

    @gurneyalex I could reproduce. I don't think this error can be avoided completely, and there is code to retry around that error. However that code seems ineffective. See #867.

  2. reopened this on Jan 2, 2026
  3. sbidoul commented on Jan 2, 2026

    @sbidoul
    Member

    Hm, no, re-reading your error, #867 does not fix it and I reproduced something different.

  4. github-actions commented on Jul 5, 2026

    @github-actions

    There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
    If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

  5. added
    stalePR/Issue without recent activity, it'll be soon closed automatically.
    on Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstalePR/Issue without recent activity, it'll be soon closed automatically.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions