queue
queue copied to clipboard
[16.0][IMP] queue_job: Requeue stuck jobs channel-based config
- Add the option to configure the
enqueued_deltaandstarted_deltaparameters on a channel by channel basis. If not set it will use the global value set in the cron - The use case we have for this is that we use the cron to catch any jobs that get stuck in
startedwhen the Odoo gets automatically deployed, in order for it to be mostly invisible to the end user and not have a blocked queue for long, the value should be low (5 or so). But we have some other processes that due to the length get sent to background tasks as jobs and might exceed this 5 minute mark, causing them to requeue infinitely. The ideal situation is optimizing the job or refactoring the whole thing to have <5min jobs but being able to allow some jobs to be longer is much more convenient and often will be enough of a solution to the issue.
Some extra notes
- The domain it generates is much bigger than the previous one depending on the number of channels, but the cron execution was still instantaneous during my tests on a database with 26 channels and 3.5m job records
- The
[("channel", "not in", searched_channels)]part of the domain is for jobs that are created in a specific channel but without creating the correspondingqueue.job.channelrecord, I would deem it technically a poor usage by the job creator (I have done it before) but it would be a regression for these cases if not taken into account
Hi @guewen, some modules you are maintaining are being modified, check this out!
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.
Work on a more robust solution is in progress in #716