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

concurrent-ruby 1.1.10 spikes volume of jobs #701

Closed
ghost opened this issue Apr 6, 2022 · 8 comments · Fixed by #702 or #706
Closed

concurrent-ruby 1.1.10 spikes volume of jobs #701

ghost opened this issue Apr 6, 2022 · 8 comments · Fixed by #702 or #706
Assignees

Comments

@ghost
Copy link

ghost commented Apr 6, 2022

Describe the bug
When using concurrent-ruby 1.1.10, the gem does not behave as expected. For the application we are implementing in, after upgrading to sidekiq-unique-jobs 7.1.16 we started getting alerts about a higher than normal volume of calls going out to a service that was approaching our rate limit. Attempting the upgrade again with concurrent-ruby dropped to 1.1.9 had no issues. It looks like the fix applied in #688 for #697 has some unexpected consequences.

Expected behavior
Jobs would be unique, allowing for a consistent pattern of calls to hold.

Current behavior
Jobs spike in volume, suggesting some non-unique jobs are making it through.

Worker class

class MyWorker
  include Sidekiq::Worker
  sidekiq_options queue: :default,
    retry: false,
    backtrace: true,
    lock: :until_executed,
    on_conflict: :log,
    log_duplicate_payload: !Rails.env.test?

  def perform(args); end
end

Additional context
I noticed the upgrade contained separate logic based on the version of concurrent-ruby used, so it makes sense that downgrading it fixed it, I haven't looked deep enough to see what could be wrong though.

@mhenrixon
Copy link
Owner

I had a feeling it wouldn’t be so easy. Shame they removed the timeouts instead of using my version.

I’ll copy the previous version of the timer task and use that instead.

Thank you for reporting.

@mhenrixon
Copy link
Owner

#702 I wish they would have taken my suggestion and fixed the issue instead of making the issue permanent...

@mhenrixon
Copy link
Owner

mhenrixon commented Apr 9, 2022

@ghost
Copy link
Author

ghost commented Apr 13, 2022

Something seems to still be wonky with the way this gem performs on the newest concurrent-ruby. On the below chart you can see our job patterns get really wonky and don't have the natural hourly drop in volume like they normally do when concurrent-ruby is at 1.1.10:
image

Through my testing this only happens if concurrent-ruby is 1.1.10 and sidekiq-unique-jobs is 7.1.16 or greater. Curiously it does not occur when sidekiq-unique-jobs 7.1.15 is paired with concurrent-ruby 1.1.10 or less.

@mhenrixon
Copy link
Owner

I hear you, I'll write my own timeout functionality then and hopefully it won't matter which concurrent version you are having.

Frigging dependencies aye?

@ghost
Copy link
Author

ghost commented Apr 19, 2022

Really appreciate that!

Frigging dependencies aye?

Haha yup

@mhenrixon
Copy link
Owner

@oneandonlymike see if v7.1.20 works better for you

@ghost
Copy link
Author

ghost commented Apr 25, 2022

v7.1.20 seems to have done the trick! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant