Open golubovai opened 2 months ago
It's this place in source:
async def _process_request(self, PooledConnRequest request):
"""
Processes a request.
"""
cdef BaseThinConnImpl conn_impl
try:
if request.requires_ping:
try:
request.conn_impl.set_call_timeout(self._ping_timeout)
await request.conn_impl.ping()
request.conn_impl.set_call_timeout(0)
request.completed = True
except exceptions.Error:
request.conn_impl._force_close()
request.conn_impl = None
else:
conn_impl = await self._create_conn_impl(request.params)
if request.conn_impl is not None:
request.conn_impl._force_close()
request.conn_impl = conn_impl
request.conn_impl._is_pool_extra = request.is_extra
request.completed = True
except Exception as e:
request.exception = e
finally:
request.in_progress = False
request.bg_processing = False
On else we create new connection by non waiting request with no respect to value of current opened connections because condition in _get_next_request push it to process:
if not request.waiting \
or request.requires_ping \
or request.is_replacing \
or request.is_extra \
or self._open_count < self.max:
I think we can change this to: elif self._open_count < self.max or elif request.waiting and self._open_count < self.max depending on our wish to account timeouted request in connect creation.
The recent changes I pushed to the pool code should resolve this situation as well. Can you confirm, please?
@golubovai python-oracledb 2.5 has the change @anthony-tuininga made. Can you try it out and let us know whether it resolves your problem?
Hi. I have a similar situation. Updating to the latest version did not work. With long running queries, the number of connections in the pool exceeds the maximum limit.
Can you provide more detail of your situation? What are the pool configuration parameters you are using? What are you using to determine the number of connections in the pool? Can you define "long running"? Anything else you can provide that would help determine the source of the issue? Ideally a test case that proves what you are saying would be helpful!
Hello! This test case can be used to clarify what is going: