-
-
Notifications
You must be signed in to change notification settings - Fork 532
[18.0][PORT] queue_job: remove dead jobs requeuer cron and automatically requeue dead jobs #749
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
Conversation
|
Hi @guewen, |
11688d3 to
58bf17f
Compare
|
@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 👍
| WHERE | ||
| module='queue_job' | ||
| AND model='ir.cron' | ||
| AND name='ir_cron_queue_job_garbage_collector' |
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.
You may directly want to consider this fix: 46b0d8f
42a1df0 to
f64b966
Compare
|
@hbrunn, I came up with the solution of loading test What do you think about it? |
5fd02bb to
dca717b
Compare
| model="queue.job" | ||
| eval="('test_enqueued_job',)" | ||
| /> | ||
| </odoo> |
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 this file should be removed as it was moved to test_queue_job?
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, well spotted!
57d2771 to
d071197
Compare
simahawk
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. Remember to merge w/ nobump.
|
Setting as draft. There is a conflicts and the tests need some rework. |
…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.
c009b9d to
ef00b65
Compare
|
I reworked the tests and decided to isolate the tests in |
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
|
This PR has the |
|
/ocabot merge major |
|
On my way to merge this fine PR! |
|
Congratulations, your PR was merged at c6f5ba8. Thanks a lot for contributing to OCA. ❤️ |
FW port of #748 + #816