-
-
Notifications
You must be signed in to change notification settings - Fork 477
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
[18.0][PORT] queue_job: remove dead jobs requeuer cron and automatically requeue dead jobs #749
base: 18.0
Are you sure you want to change the base?
Conversation
Hi @guewen, |
…eue jobs in timeout [IMP] queue_job: increment 'retry' when re-queuing job that have been killed
A model is better than a manually managed table as it will protect the table from deletion by database_cleanup.
@sbidoul looks like you have to rewrite this to use savepoints? |
I'm note sure it's possible to test that with savepoints, since we test database locks. |
self.assertEqual(1, len(locks)) | ||
|
||
# commit to update queue_job records in DB | ||
self.env.cr.commit() # pylint: disable=E8102 |
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.
@AnizR in this test, is it necessary to commit?
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.
Yes, otherwise, the row representing a 'lock' will not be created within the db
job_obj.set_started() | ||
|
||
job_obj.store() | ||
self.env.cr.commit() # pylint: disable=E8102 |
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.
Here we could maybe create a job with demo data, and run this test post install.
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.
Using data to create some records within the db might be a way to avoid to commit within tests, I'll think about it 👍
FW port of #748