Skip to content

[18.0][ADD] queue_job: per DB channel managers with UI configuration and hot reload - #962

Draft
guewen wants to merge 5 commits into
OCA:18.0-queue-job-pausefrom
guewen:18.0-queue-job-channel-config
Draft

[18.0][ADD] queue_job: per DB channel managers with UI configuration and hot reload#962
guewen wants to merge 5 commits into
OCA:18.0-queue-job-pausefrom
guewen:18.0-queue-job-channel-config

Conversation

@guewen

@guewen guewen commented Aug 18, 2026

Copy link
Copy Markdown
Member

#765 (comment)

With this in the config file, the job runner uses the static server-side configuration as before, with no hot-reload (single, shared channel manager):

[queue_job]
channels = root:10,root.p1:2

With this in the config file, the job runner uses the channels configured in the database (the job runner builds one channel manager per database):

[queue_job]
max_capacity = 10

When capacity or other options of a channel (or channels are created/deleted, paused) change, the channel manager for the concerned database is hot reloaded.

Capacity can be constrained by database:

[queue_job]
max_capacity = 10
db_max_capacity = 2

Or with patterns

[queue_job]
max_capacity = 10
db_max_capacity = prod_*:6,staging:3,*:1

When db_max_capacity is not configured, each database gets a max capacity of the global max_capacity.
When there is more jobs pending than max_capacity across the databases, a round-robin allows each database to enqueue jobs in turns.

The channels option for server-side configuration takes precedence over the new configuration.

Using this, I can, for instance

  • Pause and resume a channel
  • Create a new channel, assign a job function this channel, set a capacity at 1 or sequential, all from the UI and applied live by the job runner

Migration path

Since the server-side configuration (ODOO_QUEUE_JOB_CHANNELS or channels in config file) is used by default, updating the addon has no effect. It allows to configure the channels capacity and other options on the UI / by script of the databases, then the server-side configuration can be replaced by the parameters max_capacity and db_max_capacity (or their environment variables counterparts).

@OCA-git-bot OCA-git-bot added the mod:queue_job Module queue_job label Aug 18, 2026
@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

Not used at this point by the jobrunner, but the changes on channels
trigger a notify to the jobrunner.
@guewen
guewen force-pushed the 18.0-queue-job-channel-config branch 3 times, most recently from 688eee4 to 9b9e3fd Compare August 18, 2026 10:35
@guewen
guewen force-pushed the 18.0-queue-job-channel-config branch from 9b9e3fd to 934ccb4 Compare August 18, 2026 12:02
@guewen guewen changed the title [18.0][ADD] queue_job: add jobrunner config on channels [18.0][ADD] queue_job: per DB channel managers with UI configuration and hot reload Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:queue_job Module queue_job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants