Skip to content
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

Open
wants to merge 3 commits into
base: 18.0
Choose a base branch
from

Conversation

sbidoul
Copy link
Member

@sbidoul sbidoul commented Mar 3, 2025

FW port of #748

@OCA-git-bot
Copy link
Contributor

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

AnizR and others added 2 commits March 3, 2025 18:41
…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.
@hbrunn
Copy link
Member

hbrunn commented Mar 21, 2025

@sbidoul looks like you have to rewrite this to use savepoints?

@sbidoul
Copy link
Member Author

sbidoul commented Mar 21, 2025

I'm note sure it's possible to test that with savepoints, since we test database locks.

@AnizR

self.assertEqual(1, len(locks))

# commit to update queue_job records in DB
self.env.cr.commit() # pylint: disable=E8102
Copy link
Member Author

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?

Copy link
Contributor

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
Copy link
Member Author

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.

Copy link
Contributor

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 👍

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.

4 participants