-
Notifications
You must be signed in to change notification settings - Fork 270
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
Fixes #31964 - Assign equal weight to sidekiq queues #927
Conversation
# # output yaml to a file | ||
# file { '/tmp/my.yaml': | ||
# ensure => file, | ||
# content => to_yaml($myhash), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# content => to_yaml($myhash), | |
# content => foreman::to_symbolized_yaml($myhash), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you caught my copy-paste
# @example Use options control the output format | ||
# file { '/tmp/my.yaml': | ||
# ensure => file, | ||
# content => to_yaml($myhash, {indentation: 4}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# content => to_yaml($myhash, {indentation: 4}) | |
# content => foreman::to_symbolized_yaml($myhash, {indentation: 4}) |
Will this handle:
|
No. I chose not to implement that. Partly because I was lazy, partly because I don't know if there is any demand for it. It may even break in some cases. |
5ab2719
to
1f85ee2
Compare
Rebased to resolve conflicts. |
1f85ee2
to
6f93ad9
Compare
This function symbolizes keys in YAML which is typically what Foreman config files use. This is hard to achieve with pure Puppet so a Ruby function is used.
The previous approach worker, but it made sidekiq default worker process all items from the default queue before moving to remote execution queue. This change adds equal weight to the queues, making sidekiq pick jobs from both.
6f93ad9
to
4567278
Compare
<<~CONTENT | ||
--- | ||
:concurrency: 1 | ||
:queues: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queues
can either be a list or a list of lists? Thats right ugly but I realize not our "concern" per this feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is indeed my impression based on @adamruzicka's patch. I think we're just exposing what Dynflow accepts.
@adamruzicka can you confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a sidekiq-specific thing[1], Dynflow has no role in this. It can be either a list or a list of two element lists, where first element is name of the queue and the other is the priority.
[1] - https://github.com/mperham/sidekiq/wiki/Advanced-Options#queues
The previous approach worker, but it made sidekiq default worker process all items from the default queue before moving to remote execution queue. This change adds equal weight to the queues, making sidekiq pick jobs from both.
To achieve this a function is introduced to convert data to YAML. Foreman typically uses symbolized keys in config files. This is hard to achieve with pure Puppet so a Ruby function is used.
Replaces #919