-
-
Notifications
You must be signed in to change notification settings - Fork 528
[15.0] [IMP] Automatically requeue dead jobs #796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 15.0
Are you sure you want to change the base?
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
|
Hi @guewen, |
993770e to
bb5c144
Compare
FrancoMaxime
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM: code review
AnizR
left a comment
There was a problem hiding this 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!
| 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), | ||
| ) | ||
|
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
| # 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, | ||
| ) |
There was a problem hiding this comment.
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
Backport of #716 .