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

[IMP] Increase buffer for jobs check in _query_requeue_dead_jobs #6

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

Conversation

PeterC10
Copy link
Collaborator

  • Up check for jobs enqueued so that they have been enqueued for at least 5 minutes
  • Don't requeue any job that isn't older than 5 minutes
  • There are cases when Odoo is busy that a job may stay in enqueued for more than 10 seconds, upping to 5 minutes will be more than enough of a buffer if there is no problem with the Odoo instance

@PeterC10 PeterC10 force-pushed the 11.0_requeue_dead_jobs_increase_buffer branch from aa39889 to de0ddee Compare February 11, 2025 11:18
* Job Queue Lock model added to track jobs being actively processed by Odoo
* Any job not being actively worked on will either be:
    * Requeued, if max_retries not reached
    * Marked as failed, if max_retries reached
* Covers cases where the Odoo instance is restarted or a job is killed by
  Odoo due to exceeding the limit_time_cpu setting

Backport of enhancement from Odoo 16 PR on OCA:  OCA#716
…ocks

* Move the check for dead jobs until after wait_notification
* Up check for jobs enqueued so that they have been enqueued for at
  least 5 minutes
* Don't requeue any job that isn't older than 5 minutes
* Use advisory locks for job_queue_lock so that the locks can persist
  for the session and not be lost if the transaction is committed
  at any point whilst the job is running or being marked as done
* Avoids potential for Odoo to inadvertantly requeue a job that
  is still running or has finished but not marked the job as done yet
@PeterC10 PeterC10 force-pushed the 11.0_requeue_dead_jobs_increase_buffer branch from de0ddee to c88f17b Compare February 14, 2025 12:20
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.

1 participant