redis icon indicating copy to clipboard operation
redis copied to clipboard

repeatedly releasing and leasing from the same thread results in starvation

Open stchang opened this issue 11 years ago • 0 comments

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.

stchang avatar Jul 18 '14 20:07 stchang