Skip to content

[18.0][IMP] queue_job: add pause option on channels - #960

Open
guewen wants to merge 1 commit into
18.0from
18.0-queue-job-pause
Open

[18.0][IMP] queue_job: add pause option on channels#960
guewen wants to merge 1 commit into
18.0from
18.0-queue-job-pause

Conversation

@guewen

@guewen guewen commented Aug 14, 2026

Copy link
Copy Markdown
Member

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 #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).

@OCA-git-bot

Copy link
Copy Markdown
Contributor

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

@amh-mw amh-mw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review only, LGTM.

Comment thread queue_job/jobrunner/channels.py Outdated
self.capacity = config.get("capacity", None)
self.sequential = bool(config.get("sequential", False))
self.throttle = int(config.get("throttle", 0))
self.paused = int(config.get("paused", False))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes of course, updated

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 #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).
@guewen
guewen force-pushed the 18.0-queue-job-pause branch from 83f72e6 to 621a998 Compare August 18, 2026 05:54
@hoangtrann

Copy link
Copy Markdown
Contributor

loving the idea. are we able to pause and got it applied right away or would it require a restart?

@guewen

guewen commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

loving the idea. are we able to pause and got it applied right away or would it require a restart?

@hoangtrann right now it needs a restart. Trying something with hot reload here #962 it somehow works with caveats but still need some work, and it changes the channel config to be per db instead of global (in my wip, you can choose between the current server-side static config that do not support hot reload or the per db config that supports hot reload).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants