From 13c6b81b603dc280736a9b99effc01d2d667d278 Mon Sep 17 00:00:00 2001 From: ravinsp Date: Fri, 18 Dec 2020 06:26:46 +0530 Subject: [PATCH] Fixed state sync abandon stale requests issue. --- src/state/state_sync.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/state/state_sync.cpp b/src/state/state_sync.cpp index 9895479f..395f907f 100644 --- a/src/state/state_sync.cpp +++ b/src/state/state_sync.cpp @@ -98,13 +98,13 @@ namespace state_sync hpfs::h32 new_state = hpfs::h32_empty; const int result = request_loop(ctx.target_state, new_state); - if (result == -1 || ctx.is_shutting_down) - break; - ctx.pending_requests.clear(); ctx.candidate_state_responses.clear(); ctx.submitted_requests.clear(); + if (result == -1 || ctx.is_shutting_down) + break; + { std::shared_lock lock(ctx.target_state_mutex);