Skip to content
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

Capsule default weights #5765

Merged
merged 1 commit into from
Feb 4, 2023
Merged

Conversation

Exterm1nate
Copy link
Contributor

@Exterm1nate Exterm1nate commented Feb 4, 2023

This PR fixes wrong weights value of Sidekiq process with implicit queues list.

If you do not provide queues in configuration explicitly, the default Sidekiq capsule initializes with default queue, but the weights stays nil, so the process's weights is [nil] instead of [{"default"=>0}] with explicit queues configuration. And it breaks Sidekiq web UI busy tab.

Explicit queues list:

# In config
sidekiq = Sidekiq.configure_embed do |config|
  config.queues = %w[default]
  config.concurrency = 2
end

# In Rails console
Sidekiq::ProcessSet.new.to_a
# => [#<Sidekiq::Process @attribs={..., "queues"=>["default"], "weights"=>[{"default"=>0}], ...}>, ...]

Implicit queues list:

# In config
sidekiq = Sidekiq.configure_embed do |config|
  config.concurrency = 2
end

# In Rails console
Sidekiq::ProcessSet.new.to_a
# => [#<Sidekiq::Process @attribs={..., "queues"=>["default"], "weights"=>[nil], ...}>, ...]

@mperham
Copy link
Collaborator

mperham commented Feb 4, 2023

The default weight for any queue which is not given a weight should be 1, not 0?

@mperham
Copy link
Collaborator

mperham commented Feb 4, 2023

Oh never mind, that would turn strict priority into random weighting.

@mperham mperham merged commit 4c47742 into sidekiq:main Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants