Skip to content

Conversation

@feketemihai
Copy link
Member

Backport of #716 .

sbidoul and others added 4 commits June 17, 2025 09:54
A model is better than a manually managed table as it will
protect the table from deletion by database_cleanup.
…eue jobs in timeout

[IMP] queue_job: increment 'retry' when re-queuing job that have been killed
@OCA-git-bot
Copy link
Contributor

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

@feketemihai feketemihai force-pushed the 15.0-remove_dead_jobs branch from 993770e to bb5c144 Compare August 27, 2025 07:36
Copy link
Member

@FrancoMaxime FrancoMaxime left a comment

Choose a reason for hiding this comment

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

LGTM: code review

Copy link
Contributor

@AnizR AnizR left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

Comment on lines +299 to +305
def set_job_pending(self, uuid):
with closing(self.conn.cursor()) as cr:
cr.execute(
"UPDATE queue_job SET state=%s, " "date_enqueued=NULL " "WHERE uuid=%s",
(PENDING, uuid),
)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that I can be removed

CASE
WHEN
max_retries IS NOT NULL AND
retry IS NOT NULL AND
Copy link
Contributor

Choose a reason for hiding this comment

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

I would cherry pick: #816 that fixes the case of having max_retries = 0

Comment on lines +490 to +501
# In case we have enqueued jobs we move them to pending,
# otherwise they remain enqueued and occupy channels slots.
if job_data[6] == "enqueued":
try:
self.db_by_name[db_name].set_job_pending(job_data[1])
job_data = (*job_data[:6], "pending")
except Exception:
_logger.warning(
"error setting job %s to pending",
job_data[1],
exc_info=True,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why do you do this?
I don't think that it is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants