diff --git a/src/main/java/com/exactpro/th2/FixHandler.java b/src/main/java/com/exactpro/th2/FixHandler.java index 6f3d310..7fb393c 100644 --- a/src/main/java/com/exactpro/th2/FixHandler.java +++ b/src/main/java/com/exactpro/th2/FixHandler.java @@ -2224,6 +2224,14 @@ private void disconnect(boolean graceful) throws ExecutionException, Interrupted sendLogout(); waitLogoutResponse(); } + while (activeRecovery.get()) { + LOGGER.debug("Waiting for recovery to finish."); + try { + Thread.sleep(100); + } catch (InterruptedException e) { + LOGGER.error("Error while waiting for recovery to finish", e); + } + } enabled.set(false); Thread.sleep(settings.getDisconnectCleanUpTimeoutMs()); channel.close().get();