From 548fb52d2474c1a6c9424b21bd0d12b865ce5bb0 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Tue, 20 Apr 2021 08:51:51 +0300 Subject: [PATCH] Fix build. --- src/Client/MultiplexedConnections.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Client/MultiplexedConnections.cpp b/src/Client/MultiplexedConnections.cpp index b095147d24e..350beffce28 100644 --- a/src/Client/MultiplexedConnections.cpp +++ b/src/Client/MultiplexedConnections.cpp @@ -13,6 +13,7 @@ namespace ErrorCodes extern const int MISMATCH_REPLICAS_DATA_SOURCES; extern const int NO_AVAILABLE_REPLICA; extern const int TIMEOUT_EXCEEDED; + extern const int UNKNOWN_PACKET_FROM_SERVER; } @@ -283,12 +284,15 @@ Packet MultiplexedConnections::receivePacketUnlocked(AsyncCallback async_callbac { packet = current_connection->receivePacket(); } - catch (...) + catch (Exception & e) { - /// Exception may happen when packet is received, e.g. when got unknown packet. - /// In this case, invalidate replica, so that we would not read from it anymore. - current_connection->disconnect(); - invalidateReplica(state); + if (e.code() == ErrorCodes::UNKNOWN_PACKET_FROM_SERVER) + { + /// Exception may happen when packet is received, e.g. when got unknown packet. + /// In this case, invalidate replica, so that we would not read from it anymore. + current_connection->disconnect(); + invalidateReplica(state); + } throw; } }