Skip to content

Commit

Permalink
Fix data race for request processor
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyWoo committed Nov 10, 2023
1 parent 23c9f5d commit 28f1351
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Service/RequestProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ void RequestProcessor::run()
return;

size_t committed_request_size = committed_queue.size();
size_t error_request_size = error_request_ids.size();
size_t error_request_size;
{
std::unique_lock lk(mutex);
error_request_size = error_request_ids.size();
}

/// 1. process read request, multi thread
for (RunnerId runner_id = 0; runner_id < runner_count; runner_id++)
Expand Down

0 comments on commit 28f1351

Please sign in to comment.