diff --git a/components/cluster/clusterlistener.cpp b/components/cluster/clusterlistener.cpp index fb6af6117..20fe633ec 100644 --- a/components/cluster/clusterlistener.cpp +++ b/components/cluster/clusterlistener.cpp @@ -443,9 +443,13 @@ void ClusterListener::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Ptr String message; while (true) { + Dictionary::Ptr pmessage; + try { if (!NetString::ReadStringFromStream(lstream, &message)) break; + + pmessage = Value::Deserialize(message); } catch (std::exception&) { Log(LogWarning, "cluster", "Unexpected end-of-file for cluster log: " + path); @@ -453,8 +457,6 @@ void ClusterListener::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Ptr break; } - Dictionary::Ptr pmessage = Value::Deserialize(message); - if (pmessage->Get("timestamp") < peer_ts) continue;