[15.0] [IMP] Automatically requeue dead jobs#796
Open
feketemihai wants to merge 6 commits intoOCA:15.0from
Open
[15.0] [IMP] Automatically requeue dead jobs#796feketemihai wants to merge 6 commits intoOCA:15.0from
feketemihai wants to merge 6 commits intoOCA:15.0from
Conversation
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
Contributor
|
Hi @guewen, |
sbidoul
approved these changes
Aug 14, 2025
993770e to
bb5c144
Compare
AnizR
suggested changes
Sep 15, 2025
Contributor
AnizR
left a comment
There was a problem hiding this comment.
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), | ||
| ) | ||
|
|
Contributor
There was a problem hiding this comment.
I think that I can be removed
| CASE | ||
| WHEN | ||
| max_retries IS NOT NULL AND | ||
| retry IS NOT NULL AND |
Contributor
There was a problem hiding this comment.
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, | ||
| ) |
Contributor
There was a problem hiding this comment.
Can you explain why do you do this?
I don't think that it is needed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #716 .