Erixonich commented on code in PR #7080:
URL: https://github.com/apache/ignite-3/pull/7080#discussion_r2598797112
##########
modules/platforms/cpp/ignite/client/detail/node_connection.cpp:
##########
@@ -203,7 +207,46 @@ std::shared_ptr<response_handler>
node_connection::find_handler_unsafe(std::int6
if (it == m_request_handlers.end())
return {};
- return it->second;
+ return it->second.handler;
+}
+
+void node_connection::handle_timeouts() {
+ auto now = std::chrono::steady_clock::now();
+
+ {
+ std::lock_guard lock(m_request_handlers_mutex);
+
+ for (auto it = m_request_handlers.begin(); it !=
m_request_handlers.end();) {
+ auto &id = it->first;
+ auto &req = it->second;
+
+ if (req.timeouts_at.has_value() && req.timeouts_at < now) {
+ std::stringstream ss;
+ ss << "Operation timeout [req_id=" << id << "]";
+ auto res =
req.handler->set_error(ignite_error(error::code::CLIENT_OPERATION_TIMEOUT,
ss.str()));
+
+ this->m_logger->log_warning(ss.str());
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]