-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 Enterprise Scheduled Jobs Not Showing up Consistently #3771
Comments
It sounds like you are running several different apps using the same Redis. You can't do this; each Redis keyspace belongs to one app, and one Sidekiq process will be elected leader to manage the periodic jobs for that app. If you have multiple apps, that's multiple leaders and they will stomp on each other's cron jobs. Easiest thing to do is to use a different Redis DB for each app, where DB is a number between 0-15: config.redis = { db: 1 } |
I can easily do that and thank you for the fast response! |
That fixed my issue! |
We often queue up jobs (due to not having namespace access in lots of various projects) like this
I noticed once I moved app 2 to |
That's sharding. App A will have a pool of connections to Redis B and tell Sidekiq::Client to push using that pool. https://github.com/mperham/sidekiq/wiki/Sharding |
This is quite a change I am not prepared to do right now -- is there anyway for the time being to do just tell Sidekiq that App A should always be the leader? |
You can restructure all your periodic jobs to be "owned" by App A. |
Ah I can do that. As long as only one app is in charge of scheduling and setting up the cron jobs it should be fine? It's only an issue when there is multiple sets? |
Actually I'm not sure that will work. |
The issue is the leadership; App B will still try to become leader. There's no way to force leadership onto a particular process because that's a SPOF. I don't think having multiple apps cohabitate a single Redis is possible currently. |
We've had multiple apps in a single redis db for years now and it's worked ok. It's only been an issue with this cron feature (so far) |
Yep, periodic jobs is the main feature that uses leadership. There's no problem using your current cron plugin in the short term; you can migrate to Enterprise's periodic feature over time or chose to stay with the plugin. |
The current cron middleware doesn't seem to be compatible with this version of sidekiq. |
Then the next approach would be to have every periodic job registered into every app so no matter which app becomes leader, it will create the jobs for all apps. |
Oh I can easily do that! thanks! |
Ruby version: 2.3.1
Sidekiq / Pro / Enterprise version(s): Sidekiq 5.1.1 / Pro 4.0.1 / Ent 1.7.0
Please include your initializer and any error message with the full backtrace.
Are you using an old version? No
Have you checked the changelogs to see if your issue has been fixed in a later version? Yes
Not quite sure what is going on. The above initializer worked fine yesterday.
This morning I woke up to convert our much longer list of cron jobs that is in a different project
Now I have several more lines like this
And all I see is No periodic jobs found when going to
/loops
.I was briefly running an empty
config.periodic{}
but I took that out and restarted all processed and it's still empty. Where can I look to debug this?The text was updated successfully, but these errors were encountered: