From 9776cd467683b15ffa7c74fa2582e987180b32eb Mon Sep 17 00:00:00 2001 From: Jean-Louis Dupond Date: Fri, 19 May 2023 10:08:03 +0200 Subject: [PATCH] Disconnect the session after SSL handshake issue When the handshake check that is added in PR #17 fails, then a ClientConnectionException is thrown, and passed up to the client in ovirt-engine. But as the connection is in some invalid state, but not disconnected, it for example causes there are no heartbeats anymore. This fix also closes the connection when there is some ClientConnectionException in the postConnect stage. This should fix #27 Signed-off-by: Jean-Louis Dupond --- .../org/ovirt/vdsm/jsonrpc/client/reactors/ReactorClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/main/java/org/ovirt/vdsm/jsonrpc/client/reactors/ReactorClient.java b/client/src/main/java/org/ovirt/vdsm/jsonrpc/client/reactors/ReactorClient.java index 5c48d87..b0a1d01 100644 --- a/client/src/main/java/org/ovirt/vdsm/jsonrpc/client/reactors/ReactorClient.java +++ b/client/src/main/java/org/ovirt/vdsm/jsonrpc/client/reactors/ReactorClient.java @@ -141,7 +141,7 @@ public void connect() throws ClientConnectionException { this.closing.set(false); clean(); postConnect(getPostConnectCallback()); - } catch (InterruptedException | ExecutionException e) { + } catch (ClientConnectionException | InterruptedException | ExecutionException e) { logException(log, "Exception during connection", e); final String message = "Connection issue " + ExceptionUtils.getRootCause(e).getMessage(); scheduleClose(message);