From 06aabcdfe1dfb0f7d13a8285ba323896e018d8b0 Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Mon, 8 Jul 2019 13:01:10 +0200 Subject: [PATCH] MORE Debug logging --- arangod/Scheduler/SupervisedScheduler.h | 5 ++++- arangod/Transaction/Methods.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arangod/Scheduler/SupervisedScheduler.h b/arangod/Scheduler/SupervisedScheduler.h index be8c7e343a..b78b173815 100644 --- a/arangod/Scheduler/SupervisedScheduler.h +++ b/arangod/Scheduler/SupervisedScheduler.h @@ -75,13 +75,16 @@ class SupervisedScheduler final : public Scheduler { explicit WorkItem(std::function&& handler) : _handler(std::move(handler)), _startTime(TRI_microtime()), _called(false) {} ~WorkItem() { - if (!_called && (TRI_microtime() - _startTime) > 0.01) { + if (!_called && (TRI_microtime() - _startTime) > 0.1) { LOG_TOPIC("hunde", ERR, arangodb::Logger::REPLICATION) << "Work item forgotten, created at " << _startTime << " that is " << (TRI_microtime() - _startTime) << "s ago."; } } + WorkItem(WorkItem const& other) = delete; + WorkItem(WorkItem && other) = default; + void operator()() { _called = true; auto waittime = TRI_microtime() - _startTime; diff --git a/arangod/Transaction/Methods.cpp b/arangod/Transaction/Methods.cpp index bc8943e8d8..49dd82fc58 100644 --- a/arangod/Transaction/Methods.cpp +++ b/arangod/Transaction/Methods.cpp @@ -1920,7 +1920,8 @@ OperationResult transaction::Methods::insertLocal(std::string const& collectionN auto localTime = TRI_microtime() - startTime; if (localTime > 0.4) { LOG_TOPIC("hunde", ERR, Logger::REPLICATION) - << "Local write slow, done after: " << localTime << "s"; + << "Local write slow, done after: " << localTime + << "s on key: " << value.get(StaticStrings::KeyString).toJson(); } if (res.ok() && replicationType == ReplicationType::LEADER) { TRI_ASSERT(collection != nullptr); @@ -1941,7 +1942,8 @@ OperationResult transaction::Methods::insertLocal(std::string const& collectionN if (TRI_microtime() - startTime > 0.4) { LOG_TOPIC("hunde", ERR, Logger::REPLICATION) << "Replication write slow, done after: " << (TRI_microtime() - startTime) - << "s local used: " << localTime << "s"; + << "s local used: " << localTime + << "s on key: " << value.get(StaticStrings::KeyString).toJson(); } if (options.silent && countErrorCodes.empty()) { // We needed the results, but do not want to report: