Repository navigation
[14.0][FW] queue_job: multiple ports from 18.0 - #987
Merged
OCA-git-bot merged 43 commits intoOct 26, 2026
Merged
Conversation
Without this fix, if db_replica_host is set, Odoo might pass a readonly database cursor and the FOR UPDATE in the method would fail.
Without this, we leak connections to Databases that don't have queue_job installed.
Without this we risk connection leaks in case of exceptions in the constructor.
|
The following commit authors need to sign the Contributor License Agreement: |
Contributor
|
Hi @guewen, |
florentx
force-pushed
the
oca-port-queue_job-18.0-to-14.0-d5fef7
branch
4 times, most recently
from
September 22, 2026 11:58
102d592 to
e4ea840
Compare
Contributor
florentx
force-pushed
the
oca-port-queue_job-18.0-to-14.0-d5fef7
branch
2 times, most recently
from
September 22, 2026 12:34
1a19365 to
3d46fe9
Compare
…eue jobs in timeout [IMP] queue_job: increment 'retry' when re-queuing job that have been killed
florentx
force-pushed
the
oca-port-queue_job-18.0-to-14.0-d5fef7
branch
from
September 22, 2026 12:53
3d46fe9 to
b9139f3
Compare
'name' attributes for odoo's exception has been deprecated and produces a warning message. This commit fixes the behavior
datetime.datetime.utcnow() is now deprecated and should be replaced by datetime.datetime.now() (optional TZ parameter). As the original _odoo_now() doesn't contain the Timezone, the parameter datetime.UTC is not added into this improvement
When a SerializationFailure occurs when updating the state of dependent jobs, the cursor is not usable anymore so the retry failed with `current transaction is aborted`. A savepoint fixes that.
florentx
force-pushed
the
oca-port-queue_job-18.0-to-14.0-d5fef7
branch
from
September 22, 2026 12:57
b9139f3 to
b7adb84
Compare
In this commit we cleanly separate the job acquisition (i.e. verifying the job is in the exepected state, marking it started and locking it) from job execution. We also avoid trying to start the job if it is already locked by using SKIP LOCKED and exiting early. Indeed in such situations the job is likely already being handled by another worker so there is no point trying to start it, so we exit early and let it be handled either by the other worker or the dead job requeuer.
Extract the logic to run one job out of the /queue_job/runjob route. Towards making this logic reusable in other job executors.
…ethod We add the `_subscribe_job_creator` method in `queue.job` which will return True for the cases where we want to subscribe the job creator, False otherwise.
Jobs are always created through sudo() in the Job class, and always deleted by the cron, never by users. See discussion on OCA#802 (comment)
…rts patches Otherwise monkey-patches could be added twice when instantiating new test classes.
(cherry picked from commit 47b8c48) [ported to 18.0: isinstance union syntax for ruff UP038]
Add a new "paused" option on channel configuration. A paused channel is equivalent to a channel with no capacity: it yields no job and also blocks all its subchannels. It still needs a restart of the jobrunner, so it does not allow dynamic pause/resume, but hot reload may be added later in OCA#765. It still is an improvement over setting the capacity at 0, because it keeps the capacity in the configuration (removing the option in the config restores the initial capacity). Also, it does not require changing the channel of a job, which is an issue when resuming paused jobs (they should go back to their former channel to be resumed with their expected properties related to capacity/sequential/throttle).
Allows to execute a model function when the job fails and will not be retried. [REF] queue_job: Move on fail definition to job function Rename on_fail_hook to on_fail
Job.on_fail_method_name was only set as an instance attribute when the job function configured on_fail_method, so on_fail() raised AttributeError for every job that didn't opt into it.
This adds `capacity_default` and `sequential_default` options that set `capacity` and `sequential` for autocreated subchannels. It also allows non-root channel configurations to omit capacity.
Logging the usage of queue_job__no_delay makes sense only in 'production mode'. We have tons of tests explicitly bypassing jobs and that generates a lot of useless entries in the logs.
florentx
force-pushed
the
oca-port-queue_job-18.0-to-14.0-d5fef7
branch
from
September 22, 2026 15:49
b7adb84 to
e1505a3
Compare
TDu
approved these changes
Sep 25, 2026
Member
|
@florentx do you have production databases running with these backports? |
Contributor
Author
guewen
approved these changes
Oct 26, 2026
Member
|
/ocabot merge nobump |
Contributor
|
On my way to merge this fine PR! |
Contributor
|
Congratulations, your PR was merged at 657c768. Thanks a lot for contributing to OCA. ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port from 18.0 to 14.0:
datetime.datetime.utcnow()in_odoo_now()#813enqueue_waiting#867The following PRs have been blacklisted: