From cb110f948d06cc7d4d61f81c15da38f38181c89c Mon Sep 17 00:00:00 2001 From: Anthony Tuininga Date: Fri, 6 Dec 2024 13:57:11 -0700 Subject: [PATCH] All exceptions subclassed from OSError now cause connection retry attempts, subject to the connection "retry_count" and "retry_delay" (#420). --- doc/src/release_notes.rst | 4 ++++ src/oracledb/impl/thin/connection.pyx | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/src/release_notes.rst b/doc/src/release_notes.rst index bea1c43..b4dc95e 100644 --- a/doc/src/release_notes.rst +++ b/doc/src/release_notes.rst @@ -21,6 +21,10 @@ Thin Mode Changes :data:`oracledb.DB_TYPE_LONG` or :data:`oracledb.DB_TYPE_LONG_RAW` to to a different compatible type (`issue 424 `__). +#) All exceptions subclassed from ``OSError`` now cause connection retry + attempts, subject to the connection ``retry_count`` and ``retry_delay`` + parameters + (`issue 420 `__). Thick Mode Changes ++++++++++++++++++ diff --git a/src/oracledb/impl/thin/connection.pyx b/src/oracledb/impl/thin/connection.pyx index d6d58ae..e162779 100644 --- a/src/oracledb/impl/thin/connection.pyx +++ b/src/oracledb/impl/thin/connection.pyx @@ -331,8 +331,7 @@ cdef class ThinConnImpl(BaseThinConnImpl): try: protocol._connect_phase_one(self, params, description, address, connect_string) - except (exceptions.DatabaseError, socket.gaierror, - ConnectionRefusedError) as e: + except (exceptions.DatabaseError, socket.gaierror, OSError) as e: if raise_exception: errors._raise_err(errors.ERR_CONNECTION_FAILED, cause=e, connection_id=description.connection_id)