diff options
author | Stefan Hoffmann <stefan.hoffmann@cloudandheat.com> | 2023-04-21 10:29:36 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2023-04-26 14:56:35 +0200 |
commit | cbe5852d76078bd1d4c64d13c62fc8ecad6bd6f2 (patch) | |
tree | 44f39f91695f2f5c8667ab559b4ae96228ecb01a | |
parent | be3caf4553f8d9e67c2cf9ad73c652fd57fb2919 (diff) | |
download | openvswitch-cbe5852d76078bd1d4c64d13c62fc8ecad6bd6f2.tar.gz |
python-stream: Handle SSL error in do_handshake.
In some cases ovsdb server or relay gets restarted, ovsdb python clients
may keep the local socket open. Instead of reconnecting a lot of failures
will be logged.
This can be reproduced with ssl connections to the server/relay and
restarting it, so it has the same IP after restart.
This patch catches the Exceptions at do_handshake to recreate the
connection on the client side.
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Stefan Hoffmann <stefan.hoffmann@cloudandheat.com>
Signed-off-by: Luca Czesla <luca.czesla@mail.schwarz>
Signed-off-by: Max Lamprecht <max.lamprecht@mail.schwarz>
Co-authored-by: Luca Czesla <luca.czesla@mail.schwarz>
Co-authored-by: Max Lamprecht <max.lamprecht@mail.schwarz>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r-- | python/ovs/stream.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/python/ovs/stream.py b/python/ovs/stream.py index ac5b0fd0c..b32341076 100644 --- a/python/ovs/stream.py +++ b/python/ovs/stream.py @@ -824,7 +824,8 @@ class SSLStream(Stream): self.socket.do_handshake() except ssl.SSLWantReadError: return errno.EAGAIN - except ssl.SSLSyscallError as e: + except (ssl.SSLSyscallError, ssl.SSLZeroReturnError, + ssl.SSLEOFError, OSError) as e: return ovs.socket_util.get_exception_errno(e) return 0 |