diff --git a/src/query/v2/request_router.hpp b/src/query/v2/request_router.hpp index b38d4d005..7e9831a70 100644 --- a/src/query/v2/request_router.hpp +++ b/src/query/v2/request_router.hpp @@ -45,6 +45,7 @@ #include "utils/result.hpp" namespace memgraph::query::v2 { + template class RsmStorageClientManager { public: @@ -608,7 +609,12 @@ class RequestRouter : public RequestRouterInterface { auto &request = running_requests.at(ready.GetId()); auto &storage_client = GetStorageClientForShard(request.shard); - auto poll_result = storage_client.PollAsyncReadRequest(ready); + std::optional> poll_result = + storage_client.PollAsyncReadRequest(ready); + + if (!poll_result.has_value()) { + continue; + } if (poll_result->HasError()) { throw std::runtime_error("RequestRouter Read request timed out"); @@ -649,7 +655,12 @@ class RequestRouter : public RequestRouterInterface { auto &request = running_requests.at(ready.GetId()); auto &storage_client = GetStorageClientForShard(request.shard); - auto poll_result = storage_client.PollAsyncWriteRequest(ready); + std::optional> poll_result = + storage_client.PollAsyncWriteRequest(ready); + + if (!poll_result.has_value()) { + continue; + } if (poll_result->HasError()) { throw std::runtime_error("RequestRouter Write request timed out"); diff --git a/src/storage/v3/shard_rsm.cpp b/src/storage/v3/shard_rsm.cpp index 639ffd6d8..b919d217c 100644 --- a/src/storage/v3/shard_rsm.cpp +++ b/src/storage/v3/shard_rsm.cpp @@ -611,7 +611,7 @@ msgs::ReadResponses ShardRsm::HandleRead(msgs::GetPropertiesRequest &&req) { return limit; }; - auto collect_response = [get_limit, &req](auto &elements, auto create_result_row) { + auto collect_response = [get_limit, &req](auto &elements, auto create_result_row) -> msgs::ReadResponses { msgs::GetPropertiesResponse response; const auto limit = get_limit(elements); for (size_t index = 0; index != limit; ++index) { diff --git a/tests/simulation/request_router.cpp b/tests/simulation/request_router.cpp index bc5168483..0f712793f 100644 --- a/tests/simulation/request_router.cpp +++ b/tests/simulation/request_router.cpp @@ -18,6 +18,8 @@ #include #include +#include + #include "common.hpp" #include "common/types.hpp" #include "coordinator/coordinator_client.hpp" @@ -370,4 +372,7 @@ void DoTest() { } } // namespace memgraph::query::v2::tests -int main() { memgraph::query::v2::tests::DoTest(); } +int main() { + spdlog::cfg::load_env_levels(); + memgraph::query::v2::tests::DoTest(); +}