From b73925d25803b78dbbaf37d35799cb4a09a54d67 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Tue, 21 Jun 2022 10:58:12 +0200 Subject: [PATCH] Fix cursor already closed error on retryable errors When a job is postponed because of a retryable error, as the error is not re-raised, we reach the new method self._enqueue_dependent_jobs(env, job) With a closed cursor. Return early in case of postponing, as there is no chance dependent jobs can become pending anyway. --- queue_job/controllers/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/queue_job/controllers/main.py b/queue_job/controllers/main.py index e47461eab0..6ce3a7c071 100644 --- a/queue_job/controllers/main.py +++ b/queue_job/controllers/main.py @@ -148,6 +148,7 @@ def retry_postpone(job, message, seconds=None): # traceback in the logs we should have the traceback when all # retries are exhausted env.cr.rollback() + return "" except (FailedJobError, Exception) as orig_exception: buff = StringIO()