Skip to content

Commit 569d5a3

Browse files
Fixed bug when timeout is not None when creating a pool (#166).
1 parent 325f108 commit 569d5a3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: doc/src/release_notes.rst

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Thin Mode Changes
1515

1616
#) Fixed bug when SQL is executed after first being parsed with Oracle
1717
Database 23c.
18+
#) Fixed bug when timeout is not ``None`` when creating a pool
19+
(`issue 166 <https://github.com/oracle/python-oracledb/issues/166>`__).
1820
#) Replaced regular expressions for parsing SQL with regular expressions that
1921
perform better
2022
(`issue 172 <https://github.com/oracle/python-oracledb/issues/172>`__).

Diff for: src/oracledb/impl/thin/pool.pyx

+4-3
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,10 @@ cdef class ThinPoolImpl(BasePoolImpl):
328328
current_time = time.monotonic()
329329
while self.get_open_count() > self.min and conn_impls_to_check:
330330
conn_impl = conn_impls_to_check[0]
331-
if current_time - conn_impl._time_in_pool > self._timeout:
332-
conn_impls_to_check.pop(0)
333-
self._drop_conn_impl(conn_impl)
331+
if current_time - conn_impl._time_in_pool < self._timeout:
332+
break
333+
conn_impls_to_check.pop(0)
334+
self._drop_conn_impl(conn_impl)
334335

335336
def acquire(self, ConnectParamsImpl params):
336337
"""

0 commit comments

Comments
 (0)