redis
redis copied to clipboard
repeatedly releasing and leasing from the same thread results in starvation
Repeatedly releasing and leasing (from the same thread) results in starvation due to hitting the max number of threads because the old conns never finish getting returned (this is assuming #6 is fixed).
For example, the following test fails:
(check-not-exn
(λ ()
(let loop ([n 100])
(unless (zero? n)
(connection-pool-return p (connection-pool-lease p))
(loop (sub1 n))))))
I'm guessing it's due to the slowness of unsubscribe because it works if I remove that cmd in release-conn. Maybe we need to treat publish/subscribe cmd as a special case.