From 2f03ec08b5a1c633133c0a38d82b05eb83708f69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Cruz?= Date: Thu, 15 Feb 2018 11:09:47 -0500 Subject: [PATCH] Add ssl "operation timed out" message for psycopg2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Added "SSL SYSCALL error: Operation timed out" to the list of messages that trigger a "disconnect" scenario for the psycopg2 driver. Pull request courtesy André Cruz. Change-Id: Ie1a8fc97e74b6906ccacf53dad70fed973c42b7f Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/3 --- doc/build/changelog/unreleased_11/pgssl_timeout.rst | 7 +++++++ lib/sqlalchemy/dialects/postgresql/psycopg2.py | 1 + 2 files changed, 8 insertions(+) create mode 100644 doc/build/changelog/unreleased_11/pgssl_timeout.rst diff --git a/doc/build/changelog/unreleased_11/pgssl_timeout.rst b/doc/build/changelog/unreleased_11/pgssl_timeout.rst new file mode 100644 index 0000000000..1916b161ed --- /dev/null +++ b/doc/build/changelog/unreleased_11/pgssl_timeout.rst @@ -0,0 +1,7 @@ +.. change:: + :tags: bug, postgresql + :versions: 1.2.3 + + Added "SSL SYSCALL error: Operation timed out" to the list + of messages that trigger a "disconnect" scenario for the + psycopg2 driver. Pull request courtesy André Cruz. diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 81e1ade8a3..2a949c4430 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -730,6 +730,7 @@ class PGDialect_psycopg2(PGDialect): 'SSL SYSCALL error: Bad file descriptor', 'SSL SYSCALL error: EOF detected', 'SSL error: decryption failed or bad record mac', + 'SSL SYSCALL error: Operation timed out', ]: idx = str_e.find(msg) if idx >= 0 and '"' not in str_e[:idx]: -- 2.47.2