From 04673d787bdca5b1b203dd719be617d1d1c56e02 Mon Sep 17 00:00:00 2001 From: lzydmxy <13126752315@163.com> Date: Tue, 18 Jun 2024 17:31:50 +0800 Subject: [PATCH] tmp --- src/Service/RequestProcessor.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/Service/RequestProcessor.cpp b/src/Service/RequestProcessor.cpp index 2025daac55..84576becd8 100644 --- a/src/Service/RequestProcessor.cpp +++ b/src/Service/RequestProcessor.cpp @@ -302,26 +302,37 @@ std::unordered_set RequestProcessor::processCommittedRequest(size_t com { if (!pending_requests.contains(committed_request.session_id) || pending_requests[committed_request.session_id].empty() - || pending_requests[committed_request.session_id].front().request->isReadRequest() ) { + if (committed_request.request->getOpNum() == Coordination::OpNum::Close) + { + LOG_DEBUG(log, "Commit request got, but not in pending_requests," + "it's close requests from deadSessionCleanThread"); + + applyRequest(committed_request); + committed_queue.pop(); + continue; + } if (!pending_requests.contains(committed_request.session_id)) { LOG_DEBUG(log, "Commit request got, but not in pending_requests"); } else if (pending_requests[committed_request.session_id].empty()) { - LOG_DEBUG(log, "Commit request got, but pending_requests empty"); - } - else - { - LOG_DEBUG(log, "Commit request got, but next pending_request {}", pending_requests[committed_request.session_id].front().toSimpleString()); + LOG_DEBUG(log, "Commit request got, but pending_requests is empty, it's a Bug"); } break; } - /// apply request + // Pending reads + if (pending_requests[committed_request.session_id].front().request->isReadRequest()) + { + LOG_DEBUG(log, "Commit request got, but next pending_request {}", + pending_requests[committed_request.session_id].front().toSimpleString()); + break; + } + applyRequest(committed_request); committed_queue.pop();