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

Sidekiq Batches stuck in pending state #5143

Closed
Blokh opened this issue Jan 25, 2022 · 2 comments
Closed

Sidekiq Batches stuck in pending state #5143

Blokh opened this issue Jan 25, 2022 · 2 comments

Comments

@Blokh
Copy link

Blokh commented Jan 25, 2022

Ruby version:
2.5.5
Rails version:
5.1.6
Sidekiq / Pro / Enterprise version(s):
sidekiq-pro (5.0.0)

Greetings,
For some reason, we've been encountering an issue of disappearing/stuck batch jobs.

Those jobs do not finish. does not enqueue and cannot be found in either Queue, Busy or Retryset.

they are stuck in a pending state in the batch until for some unknown reason they get "start" working again.
this time is random. sometimes at 3 am sometimes at 1 pm.

Does anyone else encounter this issue? was it resolved in the more recent sidekiq versions?

Thanks in advance,
Daniel

image

@Blokh
Copy link
Author

Blokh commented Jan 25, 2022

One more question.
What are the possible reason for the batch, on success not to be called?

Currently, I've got a batch with all of his jobs finished successfully.
and the batch's on_success callback is not being received. even though the queue is empty.

What might be the cause of it?

@mperham
Copy link
Collaborator

mperham commented Jan 25, 2022

If you have issues, it's always a good idea to update Sidekiq Pro. There have been numerous releases since 5.0.0. bundle up sidekiq-pro

Stuck batches are probably the #1 issue in Sidekiq.

  • The cause is always the same: deployment kills the process, which leads to lost jobs.
  • The workaround: enable super_fetch and restart the process to rescue any orphaned jobs.
  • The solution: rework your deployment process so Sidekiq can shut down cleanly and not lose jobs in the first place.

https://github.com/mperham/sidekiq/wiki/Deployment#overview

@mperham mperham closed this as completed Jan 25, 2022
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

2 participants