You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My app experienced an explosion of redis connections after I started using this gem, which is a problem because the redis service I use has a connection cap. It seems that this gem never disconnects redis connections, nor does it use a redis connection pool. Redis connections are left open until their ruby objects are eventually garbage collected.
The easiest solution for me was to shim some disconnect code into the "unlock" method, since I was overriding the suo gem adapter anyway so I could specify a port and password (see #3).
In this case the relevant code is:
module SuoLockingAdapterExtension
def unlock
super
lock_manager.client.close
end
end
ActiveJob::Locking::Adapters::SuoRedis.send :prepend, SuoLockingAdapterExtension
Not sure how you want to incorporate that into the gem, but the line of code would presumably be needed by all redis services. I just happen to be using Suo.
The text was updated successfully, but these errors were encountered:
(Quantitatively speaking, I was seeing 150+ open connections regularly. My redis service caps at 200, and I never have more than 10 jobs running simultaneously, which is rare.)
My app experienced an explosion of redis connections after I started using this gem, which is a problem because the redis service I use has a connection cap. It seems that this gem never disconnects redis connections, nor does it use a redis connection pool. Redis connections are left open until their ruby objects are eventually garbage collected.
The easiest solution for me was to shim some disconnect code into the "unlock" method, since I was overriding the suo gem adapter anyway so I could specify a port and password (see #3).
In this case the relevant code is:
Not sure how you want to incorporate that into the gem, but the line of code would presumably be needed by all redis services. I just happen to be using Suo.
The text was updated successfully, but these errors were encountered: