From de0a5842af8f4eeffeeb9128d553ffada9ec46ea Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Thu, 20 Feb 2020 20:13:29 -0400 Subject: [PATCH] Added debugging around pending request creation/removal --- lokimq/lokimq.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lokimq/lokimq.cpp b/lokimq/lokimq.cpp index f138b08..04513df 100644 --- a/lokimq/lokimq.cpp +++ b/lokimq/lokimq.cpp @@ -699,6 +699,7 @@ void LokiMQ::proxy_send(bt_dict_consumer data) { } if (request) { + LMQ_LOG(debug, "Added new pending request ", to_hex(request_tag)); pending_requests.insert({ request_tag, { std::chrono::steady_clock::now() + REQUEST_TIMEOUT, std::move(*request_cbptr) }}); } @@ -921,6 +922,7 @@ void LokiMQ::proxy_conn_cleanup() { for (auto it = pending_requests.begin(); it != pending_requests.end(); ) { auto& callback = it->second; if (callback.first < now) { + LMQ_LOG(debug, "pending request ", to_hex(it->first), " expired, invoking callback with failure status and removing"); job([callback = std::move(callback.second)] { callback(false, {}); }); it = pending_requests.erase(it); } else {