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

(bug) MultiScheduler polling bug #171

Closed
mchristen opened this issue Nov 10, 2020 · 2 comments · Fixed by #172
Closed

(bug) MultiScheduler polling bug #171

mchristen opened this issue Nov 10, 2020 · 2 comments · Fixed by #172
Labels
bug Something isn't working

Comments

@mchristen
Copy link

Previously, before LISTEN/NOTIFY support, each scheduler in the multi-scheduler was called in succession using map(if state is nil, like it was from the poll), but now with the use of the any? enumerator only the schedulers up until the first one that returns true will be called.

I think with the change in v1.3.1 to extract the poller logic we have uncovered an unexpected consequence from the change to the multi-scheduler.

If you execute GOOD_JOB_QUEUES="other_queue:2;*" bundle exec good_job there is only SQL debug output for polling the 'other_queue'.

So the bug is that if you restart the job workers while a queue has jobs in it, the old jobs are never picked up(until a notifier message shows up at least) for any queue but the first one listed in the scheduler list when they are restarted.

I tested against v1.3.0, and you can see the SQL output from checking both queue lists in the multi-scheduler.

I don't know this codebase well enough to know how the changes in 1.3.1 are now causing this behavior, I would have expected this behavior to have started back when the LISTEN/NOTIFY stuff was implemented...

@bensheldon
Copy link
Owner

Thank you for the bug report and the investigation. That makes sense for what is happening.

This should be fixed.

@bensheldon
Copy link
Owner

@mchristen I just released v1.3.2 that contains a fix for this. Thank you again for reporting it 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants