From 36593d5cc378ff7824aa0677a0ff219507599264 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov Date: Wed, 28 Apr 2021 13:26:23 +0300 Subject: [PATCH] reinitialize the connection after errors --- programs/client/Client.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/programs/client/Client.cpp b/programs/client/Client.cpp index 405ef36e980..d9ba2ddaf08 100644 --- a/programs/client/Client.cpp +++ b/programs/client/Client.cpp @@ -1518,6 +1518,11 @@ private: server_exception.reset(); client_exception.reset(); have_error = false; + + // We have to reinitialize connection after errors, because it + // might have gotten into a wrong state and we'll get false + // positives about "Unknown packet from server". + connection->forceConnected(connection_parameters.timeouts); } else if (ast_to_process->formatForErrorMessage().size() > 500) {