From c6ca21c4d6e7a41259b6e92719ca9f4d684a22c9 Mon Sep 17 00:00:00 2001 From: "denis.plotnikov" Date: Fri, 29 Nov 2024 17:48:53 +0300 Subject: [PATCH] Check if channel is enabled or active logon exchange is in progress for gracefull disconnect --- src/main/java/com/exactpro/th2/FixHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/exactpro/th2/FixHandler.java b/src/main/java/com/exactpro/th2/FixHandler.java index 820da2e..36b024f 100644 --- a/src/main/java/com/exactpro/th2/FixHandler.java +++ b/src/main/java/com/exactpro/th2/FixHandler.java @@ -2634,7 +2634,11 @@ private void disconnect(boolean graceful) throws ExecutionException, Interrupted resetHeartbeatTask(); resetTestRequestTask(); Thread.sleep(settings.getDisconnectCleanUpTimeoutMs()); - channel.close().get(); + if(!graceful) { + channel.close().get(); + } else if(!enabled.get() && activeLogonExchange.get()) { + channel.close().get(); + } } private void openChannelAndWaitForLogon() throws ExecutionException, InterruptedException {