Fix connection pool test_sqlor causing connection pileup under high concurrency
Remove test_sqlor() validation from SqlorPool.context() which was causing: - Every request to test ALL idle connections with SELECT 1 - Healthy connections being incorrectly deleted due to timeout under load - Race conditions when multiple requests test the same connection - Excessive connection creation leading to 501 Sleep connections The new logic takes the first available connection without validation. If a connection fails during actual use, the exception propagates naturally.
This commit is contained in:
parent
f6c6b4d913
commit
a2ef1bc48a
@ -118,12 +118,8 @@ class SqlorPool:
|
|||||||
yielded_sqlor = None
|
yielded_sqlor = None
|
||||||
for s in sqlors:
|
for s in sqlors:
|
||||||
if not s.used:
|
if not s.used:
|
||||||
flg = await self.test_sqlor(s.sqlor)
|
|
||||||
if flg:
|
|
||||||
yielded_sqlor = s
|
yielded_sqlor = s
|
||||||
else:
|
break # Take first available connection without testing
|
||||||
await self._del_sqlor(s.sqlor)
|
|
||||||
self.sqlors = [ x for x in self.sqlors if x != s ]
|
|
||||||
if not yielded_sqlor:
|
if not yielded_sqlor:
|
||||||
yielded_sqlor = await self._new_sqlor()
|
yielded_sqlor = await self._new_sqlor()
|
||||||
yielded_sqlor.used = True
|
yielded_sqlor.used = True
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user