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 {