From 04da62707ed0748fbaedf4f466c047f67c430625 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov Date: Thu, 5 Aug 2021 14:34:13 +0300 Subject: [PATCH] more careful handling of reconnects in fuzzer --- programs/client/Client.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/programs/client/Client.cpp b/programs/client/Client.cpp index 6ed6d5404a3..47c2fed8686 100644 --- a/programs/client/Client.cpp +++ b/programs/client/Client.cpp @@ -1449,7 +1449,12 @@ private: "Error while reconnecting to the server: {}\n", getCurrentExceptionMessage(true)); - assert(!connection->isConnected()); + // The reconnection might fail, but we'll still be connected + // in the sense of `connection->isConnected() = true`, + // in case when the requested database doesn't exist. + // Disconnect manually now, so that the following code doesn't + // have any doubts, and the connection state is predictable. + connection->disconnect(); } }