veeqo/activejob-uniqueness

Deleting many items in the queue results in timeouts

benoist opened this issue · 1 comments

Hi,

Thanks for creating this awesome gem.

We've been using this for a while but when I upgraded to a recent version, I noticed that the deletion of jobs now also removes the lock. That's great, however when you delete a full queue of 1000+ items this causes timeouts on sidekiq admin and it actually doesn't seem to be clearing the queue.

My previous method was always to clear the queue and then unlock all items.
This method is much faster.
Perhaps a similar method can be used to unlock all items when you delete a full queue?

Hey @benoist,
Sorry for the late response. I think there is no way to make the gem faster as queue name is not present in lock key and a queue may hold jobs of any class. Deleting a Sidekiq queue results "N+1"s of lock cleanup per job.
I'll try to make sidekiq patch to be optional, so in your case you could disable it completely and you could use your locks cleanup approach.