-
Notifications
You must be signed in to change notification settings - Fork 368
Allow overwrite of delayed job priorities #2693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6f3c000 to
f1d2555
Compare
With this change the job priority can be overwritten in the cloud controller
config. Therefore operators are able to prioritize e.g. cf push over service broker
operations.
It is implemented by an optional 'priorities' config parameter thus it does not
change the current behavior/ priorities. The parameter is a hash
which contains the jobs display_name and its overwritten priority (int). An example configuration could look like this:
jobs:
global:
timeout_in_seconds: 14400
priorities:
space.apply_manifest: -10
buildpack.delete: 10
The priority can also be a negative integer which is supported by the
delayed jobs gem. Negative values are also now correctly handled in
`deprioritize_job()`.
The following display names currently exist in ccng:
"service_binding.delete"
"organization.delete"
"space.delete"
"service_instance.delete"
"service_key.delete"
"service_key.delete"
"service_key.delete"
"app_model.delete"
"buildpack.delete"
"domain.delete"
"droplet_model.delete"
"droplet_model.delete"
"quota_definition.delete"
"packages_model.delete"
"role.delete"
"route.delete"
"security_group.delete"
"service_broker.delete"
"space_quota_definition.delete"
"user.delete"
"space.apply_manifest"
"admin.clear_buildpack_cache"
"service_instance.create"
"service_bindings.create"
"buildpack.upload"
"space.delete_unmapped_routes"
"service_keys.delete"
"service_instance.update"
"service_route_bindings.create"
"service_route_bindings.delete"
"service_keys.create"
"droplet.upload"
"service_bindings.delete"
"service_broker.catalog.synchronize"
"service_broker.update"
|
Any idea if jobs with 'higher' priority (e.g. priority 0 or 1) could indefinitely prevent jobs with lower priority (e.g. a job with priority 10)? Is that something you all have tested or are concerned about? We read a little bit on the delayed job readme but didn't see a definitive answer there. |
As the query includes a Also if a job has multiple attempts its priority will decrease (always doubled: 0 > 1 > 2 > 4 ...) and
This means that we already have jobs with lower priorities and those are still picked up eventually. However our plan is to use negative priorities (meaning more important) for certain jobs like cf-push so that we avoid changing the current priorities and defaults too much. In case a job with a negative priority fails (and it has retries) the next priorities would be 0,1,2... like for all other jobs. |
With this change the job priority can be overwritten in the cloud controller
config. Therefore operators are able to prioritize e.g. cf push over service
broker operations.
It is implemented by an optional 'priorities' config parameter thus it does not
change the current behavior/ priorities. The parameter is a hash which contains
the jobs display_name and its overwritten priority (int). An example
configuration could look like this:
jobs:
global:
timeout_in_seconds: 14400
priorities:
space.apply_manifest: -10
buildpack.delete: 10
The priority can also be a negative integer which is supported by the delayed
jobs gem. Negative values are also now correctly handled in
`deprioritize_job()`.
The following display names currently exist in ccng:
"service_binding.delete"
"organization.delete"
"space.delete"
"service_instance.delete"
"service_key.delete"
"service_key.delete"
"service_key.delete"
"app_model.delete"
"buildpack.delete"
"domain.delete"
"droplet_model.delete"
"droplet_model.delete"
"quota_definition.delete"
"packages_model.delete"
"role.delete"
"route.delete"
"security_group.delete"
"service_broker.delete"
"space_quota_definition.delete"
"user.delete"
"space.apply_manifest"
"admin.clear_buildpack_cache"
"service_instance.create"
"service_bindings.create"
"buildpack.upload"
"space.delete_unmapped_routes"
"service_keys.delete"
"service_instance.update"
"service_route_bindings.create"
"service_route_bindings.delete"
"service_keys.create"
"droplet.upload"
"service_bindings.delete"
"service_broker.catalog.synchronize"
"service_broker.update"
A short explanation of the proposed change:
With this change the job priority can be overwritten in the cloud controller config. This allows operators to prioritize e.g. cf push over service broker operations.
An explanation of the use cases your change solves:
It is implemented by an optional 'priorities' config parameter thus it does not change the current behavior/ priorities. The parameter is a hash which contains the jobs display_name and its overwritten priority (int).
An example configuration could look like this:
Links to any other associated PRs
Introduce optional job priorities parameter capi-release#227
Related doc PRs
Add documentation for configuring delayed job priorities docs-cf-admin#214
Add documentation for configuring delayed job priorities docs-book-cloudfoundry#118
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests