Skip to content

Commit 368cbfb

Browse files
All exceptions subclassed from "OSError" now cause connection retry
attempts, subject to the connection "retry_count" and "retry_delay" parameters (#420).
1 parent 5d150f4 commit 368cbfb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/src/release_notes.rst

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ Thin Mode Changes
2727
expected value: "{expected_name}"`` is now raised when neither the common
2828
name (CN) nor any of the subject alternative names (SANs) found on the
2929
server certificate match the host name used to connect to the database.
30+
#) All exceptions subclassed from ``OSError`` now cause connection retry
31+
attempts, subject to the connection ``retry_count`` and ``retry_delay``
32+
parameters
33+
(`issue 420 <https://github.com/oracle/python-oracledb/issues/420>`__).
3034
#) Internal change: improve low-level encoding and decoding routines.
3135

3236
Thick Mode Changes

src/oracledb/impl/thin/connection.pyx

+1-2
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,7 @@ cdef class ThinConnImpl(BaseThinConnImpl):
331331
try:
332332
protocol._connect_phase_one(self, params, description,
333333
address, connect_string)
334-
except (exceptions.DatabaseError, socket.gaierror,
335-
ConnectionRefusedError) as e:
334+
except (exceptions.DatabaseError, socket.gaierror, OSError) as e:
336335
if raise_exception:
337336
errors._raise_err(errors.ERR_CONNECTION_FAILED, cause=e,
338337
connection_id=description.connection_id)

0 commit comments

Comments
 (0)