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

NoMethodError: undefined method `check_for_orphans' for Sidekiq::Pro::SuperFetch:Class #4693

Closed
faun opened this issue Sep 16, 2020 · 9 comments

Comments

@faun
Copy link

faun commented Sep 16, 2020

Ruby version: 2.6.5
Rails version: 6.0.3.3
Sidekiq / Pro / Enterprise version(s): 6.1.2, 5.2.0

We were calling this method explicitly in a cron job and recently updated our sidekiq-pro version:

Sidekiq::Pro::SuperFetch.check_for_orphans

We periodically check for orphaned jobs and re-enqueue them for Sidekiq. It appears that this method has disappeared in a recent version of Sidekiq Pro. Is there an alternative to this method? Was the refactor related to #4602? I can't search the history of Sidekiq Pro, as it's closed source.

Thanks in advance.

@mperham
Copy link
Collaborator

mperham commented Sep 16, 2020

Yes, that API was never considered a public API so it was considered fair to refactor outside of a major version bump. I don't have an alternative API to suggest, do you still need to make that call at all?

@faun
Copy link
Author

faun commented Sep 16, 2020

I'm not sure. I'll check with my team and see if we can restart workers on some sort of cadence to recover orphaned jobs.

@faun
Copy link
Author

faun commented Sep 16, 2020

Is that the only mechanism to recover orphaned jobs?

@mperham
Copy link
Collaborator

mperham commented Sep 16, 2020

super_fetch's orphan recovery is triggered by process startup. Jobs are almost always lost on process crash or deploy, both of which lead to process startup. I'm not sure why someone wanted to run this periodically but you might want to double check their assumptions are true.

@faun
Copy link
Author

faun commented Sep 16, 2020

Thanks for the quick response. Closing.

@faun faun closed this as completed Sep 16, 2020
@fotinakis
Copy link

@mperham this was intentional, we relied on that API because we run sidekiq on Google Cloud Platform preemptible instances, which have loose guarantees about uptime and may not have a fully clean shutdown procedure, so they're more prone to orphan jobs. In production, we found that relying on worker startup to scan for orphaned jobs was not regular/consistent enough and could cause multi-hour delay in picking up orphaned jobs. In our environment we need this delay to be minimized, so we explicitly added calls to this API to more regularly check for orphans.

Definitely would be helpful to have an alternative here or to make that API public and supported.

@mperham
Copy link
Collaborator

mperham commented Sep 17, 2020

The equivalent updated API is:

Sidekiq::Pro::SuperFetch.new(Sidekiq.options).check_for_orphans

Try that.

@fotinakis
Copy link

That works great, thanks much @mperham

@fotinakis
Copy link

Note for anyone else who relies on this (internal) API: we upgraded from sidekiq-pro (5.3.1) to sidekiq-pro (5.5.1) and we had to update this to remove .options:

Sidekiq::Pro::SuperFetch.new(Sidekiq.options).check_for_orphans

-->

Sidekiq::Pro::SuperFetch.new(Sidekiq).check_for_orphans

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

No branches or pull requests

3 participants