[RFC] mechanism to configure the root channel capacity independently of other subchannels
Is your feature request related to a problem?
The queue_job channels configurations (ODOO_QUEUE_JOB_CHANNELS) is used to configure the root channel capacity, which in turn is closely related to the number of available Odoo workers. It is also used to configure subchannels which is used to control concurrency across different job types.
When configuring different environments (prod, staging, ...) the number of available Odoo workers varies across environment so we want to change the root channel capacity per environment. However, to do that we also need to update the full subchannels configuration, which leads to duplication in configurations.
Describe the solution you'd like
A mechanism to configure the root channel capacity independently of the subchannels configuration.
Describe alternatives you've considered
Copy the full configuration in each environment.
I use Terraform to configure my containers, with the environment getting set like:
{"name": "ODOO_QUEUE_JOB_CHANNELS", "value": "root:${max(local.web_workers - 2, 1)}:subcapacity=1"}
Not sure what could be better than configuration management variable interpolation.
I had previously attempted to use server_environment from OCA/server-env, but suffered from copy pasta as described. A more general YAML merge or interpolation feature might fit well there.