mobc icon indicating copy to clipboard operation
mobc copied to clipboard

fix: Change from channels to use a Semaphore

Open garrensmith opened this issue 2 years ago • 1 comments

When under very heavy load, the conn_requests can include to many Sender's with dropped Receivers. When the Conn is passed to a waiting Receiver and it was recently dropped the Conn could be lost causing a mis-count on the num_open stat which stops any new connections from being created and then mobc deadlocks.

This fixes it by switching from a oneshot channel and queue to using a Semaphore to keep track of available connections for any requests.

This fixes https://github.com/importcjj/mobc/issues/63

garrensmith avatar Mar 07 '22 12:03 garrensmith

I'll leave this PR open in case anyone else comes across this. We will be managing a forked mobc with this fix over here https://github.com/prisma/mobc

garrensmith avatar Mar 21 '22 08:03 garrensmith

Closed based on #69

garrensmith avatar Jan 21 '23 09:01 garrensmith