-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Old workers expiration issue #1704
Comments
I frequently notice after a deploy when old workers are killed and new ones started, the worker count in resque web is elevated inaccurately. Do you think this is related? |
I've also noticed this. Yeap I think it has to do with the above issue. |
Seems like there's additional information here: Lines 605 to 610 in adb633a
|
I've run into this as well. I wonder if we could add a configuration option to prune these workers automatically. If a user knows they aren't using an old version of resque or other client library, they could set the configuration option to auto-prune these workers. If someone could whip up a PR I can help review and get it merged! |
In my experience simply running It's the more complicated logic in #prune_dead_workers that is maybe deciding they are not actually prune-able, perhaps because of what @hackhowtofaq explains. It seems like a bug to me, rather than something that should have a config variable, you don't have config variables for "run with this bug fixed", right? It's just unclear to me what this more complicated logic is intended to do. Cause certainly one PR that would fix this problem would be just replacing #prune_dead_workers with the simple implementation If there aren't docs or tests about this, this is what makes it challenging to work on an under-maintained "legacy" project like this, there's nobody around with the context to understand what's up, so someone kind of has to spend some time trying to re-construct it archeologically to make changes safely. Or we could just replace the implementation with ``Resque::Worker.all_workers_with_expired_heartbeats.each(&:unregister_worker)` and if no tests fail say that's good enough? Seems risky. |
Pretty sure this is related to #1750 which has a PR associated with it. Hoping we can get that PR merged soon. |
#1750 has been merged and should fix this issue! Re-open this issue if it's still a problem. |
resque/lib/resque/worker.rb
Line 486 in adb633a
Since
worker.to_s
includes the pid, older workers with different pid but seconds_since_heartbeat > prune_interval are not expired.Are you aware of this? Is this intended?
The text was updated successfully, but these errors were encountered: