deanpcmad/sidekiq-limit_fetch

limit being ignored when multiple sidekiq services are running

metapraveen opened this issue · 0 comments

Thank you for creating this gem, this helps us a lot.

I am seeing an issue of limits are not being respected sometimes when I run multiple sidekiq services. I tried to debug this and I think the issue might be because of race condition while removing the invalid locks.
May be invalidate_old_processes runs before update_heartbeat ttl removing the valid locks here https://github.com/brainopia/sidekiq-limit_fetch/blob/master/lib/sidekiq/limit_fetch/global/monitor.rb#L11-L21. Making this thread safe should avoid this race condition.

Unfortunately, I could not write a faling test for this, since reproducing this issue is bit hard and doesn't happen always.

I will submit a PR for this soon. If any of the users of this gem have any inputs here, you are most welcome.