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:34 +0200 |
commit | 29c61a4024c48cbc5bbc4d9464713ac73cb9074f (patch) | |
tree | 4175dbb836e001c13ff9864964cce1ad15bd6f5d | |
parent | 615548e5327fe375b5821e80a2e008ba4b4df22f (diff) | |
download | openvswitch-29c61a4024c48cbc5bbc4d9464713ac73cb9074f.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 |