diff options
author | Zeke Brechtel <5767468+zkl2@users.noreply.github.com> | 2021-09-25 14:43:28 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-10-05 12:46:22 -0400 |
commit | 70cc67c3e6a123cf8210c041e5d23cbc30594ced (patch) | |
tree | dd7a1ef008fa9830545315aba36d8b1d50af681d /lib/sqlalchemy/dialects/postgresql/psycopg2.py | |
parent | 5479799e8b3930de706e4ce6a114bad374db245e (diff) | |
download | sqlalchemy-70cc67c3e6a123cf8210c041e5d23cbc30594ced.tar.gz |
Handle SSL SYSCALL error: Bad Address in postgresql/pyscopg2
Added a "disconnect" condition for the "SSL SYSCALL error: Bad address"
error message as reported by psycopg2. Pull request courtesy Zeke Brechtel.
Fixes: #5387
Closes: #7087
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7087
Pull-request-sha: 66af76a107a22d9119edc8edcacc1e4ef66dc50d
Change-Id: Ia4afc9683b8175a8ca282e07e0f83c65657544ab
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/psycopg2.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/psycopg2.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index a5a56cb6b..a71bdf760 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -1046,10 +1046,11 @@ class PGDialect_psycopg2(PGDialect): "losed the connection unexpectedly", # these can occur in newer SSL "connection has been closed unexpectedly", + "SSL error: decryption failed or bad record mac", "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", + "SSL SYSCALL error: Bad address", ]: idx = str_e.find(msg) if idx >= 0 and '"' not in str_e[:idx]: |