Skip to content

Commit d6643b2

Browse files
Ensure that open count is correct and that pool will grow if the open
count dips below min.
1 parent c5c6b4f commit d6643b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/oracledb/impl/thin/pool.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ cdef class BaseThinPoolImpl(BasePoolImpl):
239239
self._free_new_conn_impls.append(request.conn_impl)
240240
else:
241241
self._free_used_conn_impls.append(request.conn_impl)
242+
elif request.requires_ping:
243+
self._open_count -= 1
244+
if self._num_to_create == 0 and self._open_count < self.min:
245+
self._num_to_create = self.min - self._open_count
242246
self._requests.remove(request)
243247
self._condition.notify_all()
244248

@@ -852,6 +856,7 @@ cdef class PooledConnRequest:
852856
buf.check_control_packet()
853857
if buf._session_needs_to_be_closed:
854858
self.pool_impl._drop_conn_impl(conn_impl)
859+
self._open_count -= 1
855860
else:
856861
self.conn_impl = conn_impl
857862
if self.pool_impl._ping_interval == 0:

0 commit comments

Comments
 (0)