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

Add pagination to "Busy" page #5556

Merged
merged 1 commit into from
Oct 3, 2022
Merged

Conversation

fatkodima
Copy link
Member

Closes #5555.

The pagination is slower (compared to /retries etc pages), because we need to get all of the entries to sort them (by run_at) before returning. But now this loads with no problems.

Seems like it is also problematic to add mass actions like "Kill"/"Delete", because we will need to inefficiently iterate over the large list list (compared to /retries page where we can efficiently remove from the zset).

You mentioned filtering in the issue. This is Pro/Ent feature, right? So I have not access to it. Better to be implemented by you or someone else who has access.

@@ -2,14 +2,21 @@

module Sidekiq
module Paginator
def page(key, pageidx = 1, page_size = 25, opts = nil)
def page(key_or_items, pageidx = 1, page_size = 25, opts = nil)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Break this codepath out into a separate method, page_items or page_enum.

@@ -74,6 +74,9 @@ def self.set(key, val)
end

get "/busy" do
@count = (params["count"] || 25).to_i
Copy link
Collaborator

Choose a reason for hiding this comment

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

WDYT about increasing the default page size to 100 so the user's not paginating as much, given that it's a bit slow?

@fatkodima
Copy link
Member Author

Thanks, @mperham. Agreed with the suggestions.

@mperham mperham merged commit d424e45 into sidekiq:main Oct 3, 2022
@fatkodima fatkodima deleted the busy-pagination branch October 3, 2022 21:25
@ngan
Copy link

ngan commented Apr 26, 2023

We're seeing an error when visiting the Busy page after this change:

undefined method `size' for nil:NilClass

Maybe @workset can be nil?

@mperham
Copy link
Collaborator

mperham commented Apr 26, 2023

@ngan Please provide the full backtrace.

@ngan
Copy link

ngan commented Apr 26, 2023

Apologies, this might be something on our end. We're investigating further. If it's a bug on Sidekiq's side, I'll report back with lots more information.

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.

Add pagination to running jobs on "Busy" page
3 participants