Skip to content

[18.0][IMP] queue_job: do not use separate cursor to write error result - #1016

Open
florentx wants to merge 1 commit into
OCA:18.0from
camptocamp:18.0-queue_job-savepoint
Open

florentx wants to merge 1 commit into
OCA:18.0from
camptocamp:18.0-queue_job-savepoint

Conversation

@florentx

Copy link
Copy Markdown
Contributor

This is a simplification.

This is needed for the change proposed in:

Changes:

  • use a savepoint for job.perform() so that cursor can be re-used in case of OperationalError
  • do not use separate cursor for saving error result on the "queue.job" record
    -use the same cursor, which is in good shape thanks to the savepoint
  • more performant: no need of multiple cursors (except for the allow_commit=True use case)

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @sbidoul, @guewen,
some modules you are maintaining are being modified, check this out!

@amh-mw amh-mw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review only, LGTM. This reminds me of workarounds I was using locally prior to the implementation of allow_commit.

traceback_txt = buff.getvalue()
with StringIO() as buff:
traceback.print_exc(file=buff)
traceback_txt = buff.getvalue()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with the earlier reclamation of memory here; just calling it out since it is not germaine to the primary intent of this pull request.

@florentx
florentx force-pushed the 18.0-queue_job-savepoint branch from 6987195 to 39ed622 Compare October 21, 2026 19:58
@florentx
florentx force-pushed the 18.0-queue_job-savepoint branch from 39ed622 to b64a51f Compare October 21, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants