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

Changing the throttling config when jobs are running #132

Open
roykolak opened this issue Mar 8, 2023 · 0 comments
Open

Changing the throttling config when jobs are running #132

roykolak opened this issue Mar 8, 2023 · 0 comments
Labels
bug help wanted Contributions are highly appreciated question

Comments

@roykolak
Copy link

roykolak commented Mar 8, 2023

I'm currently seeing batches of jobs that are configured to throttle dynamically get stuck when the throttle configuration changes.

For example, here's my throttle config...

    sidekiq_throttle(
      concurrency: {
        limit: ->(search_id, result_id, batch_id, dynamically_assigned_queue) {
          Search.slow_search?(search_id, batch_id) ? 1 : 5
        },
        key_suffix: ->(search_id, result_id, batch_id, dynamically_assigned_queue) {
          Search.slow_search?(search_id, batch_id) ? "#{dynamically_assigned_queue}-slow" : "#{dynamically_assigned_queue}-fast"
        }
      },
      observer: ->(strategy, *args) {
        Sidekiq.logger.warn "Throttled: #{strategy} search_id: #{args[0]} queue: #{args[3]}"
      }
    )

You can see that the jobs belong to a batch and that batch gets assigned to a random shared queue.

My question is, if Search.slow_search? returns a different value in the middle of running a batch of jobs, is that a problem? I'm seeing a lot of logging that the "concurrency" strategy prevented jobs from running after Search.slow_search? changes it's boolean value.

@roykolak roykolak changed the title Changing the throttling configure when jobs are running Changing the throttling config when jobs are running Mar 8, 2023
@ixti ixti added bug help wanted Contributions are highly appreciated question labels Apr 5, 2023
@ixti ixti transferred this issue from ixti/sidekiq-throttled-clone Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted Contributions are highly appreciated question
Projects
None yet
Development

No branches or pull requests

2 participants