Repository navigation
[FIX] queue_job: don't start the jobrunner in odoo shell - #1003
Merged
Merged
Conversation
odoo shell starts the server with stop=True and stops it right away, so the runner thread was started for nothing and its START_DELAY made every shell wait 5 seconds before the prompt. Core already skips its HTTP and cron threads when stop is set; the runner now follows the same rule.
Contributor
|
Hi @guewen, |
guewen
approved these changes
Oct 6, 2026
MiquelRForgeFlow
approved these changes
Oct 7, 2026
JordiMForgeFlow
approved these changes
Oct 7, 2026
Contributor
Author
|
@guewen can we merge this one? 🙂 |
Member
|
/ocabot merge patch |
Contributor
|
Hey, thanks for contributing! Proceeding to merge this for you. |
Contributor
|
Congratulations, your PR was merged at 983b6ad. Thanks a lot for contributing to OCA. ❤️ |
This was referenced Oct 8, 2026
Contributor
Author
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.
With
queue_jobinserver_wide_modules, everyodoo shellstarts the job runner thread, stops it right away and waits for it, so the prompt only comes after 5 seconds:Cause.
odoo/cli/shell.pystarts the server withodoo.service.server.start(preload=[], stop=True), andThreadedServer.run()passes the flag on toThreadedServer.start(stop=stop). Core uses it to skip its own background services: the HTTP thread is only spawnedif config['http_enable'] and not stop, andrun()returns beforecron_spawn(). The patchedstartof queue_job ignores it and only checksconfig["stop_after_init"], which the shell does not set. The runner thread sleepsSTART_DELAY(5 s) before running, andthreaded_stop()joins it.Fix.
threaded_start()starts the runner only when the server is not started withstop=True, as core does for its HTTP and cron threads. A normal server start is unchanged, and--stop-after-initwas already skipped in_start_runner_thread().cc @ForgeFlow