20 #include <ripple/app/main/Application.h>
21 #include <ripple/app/main/LoadManager.h>
22 #include <ripple/app/misc/LoadFeeTrack.h>
23 #include <ripple/app/misc/NetworkOPs.h>
24 #include <ripple/basics/UptimeClock.h>
25 #include <ripple/beast/core/CurrentThreadName.h>
26 #include <ripple/json/to_string.h>
34 : app_(app), journal_(journal), deadLock_(), armed_(false)
48 <<
"std::exception in ~LoadManager. " << ex.
what();
104 using namespace std::chrono_literals;
107 auto t = clock_type::now();
119 auto const armed =
armed_;
124 auto const timeSpentDeadlocked =
125 duration_cast<seconds>(steady_clock::now() - deadLock);
127 constexpr
auto reportingIntervalSeconds = 10s;
128 constexpr
auto deadlockFatalLogMessageTimeLimit = 90s;
129 constexpr
auto deadlockLogicErrorTimeLimit = 600s;
131 if (armed && (timeSpentDeadlocked >= reportingIntervalSeconds))
135 if ((timeSpentDeadlocked % reportingIntervalSeconds) == 0s)
137 if (timeSpentDeadlocked < deadlockFatalLogMessageTimeLimit)
140 <<
"Server stalled for " << timeSpentDeadlocked.count()
150 <<
"Deadlock detected. Deadlocked time: "
151 << timeSpentDeadlocked.count() <<
"s";
161 if (timeSpentDeadlocked >= deadlockLogicErrorTimeLimit)
164 <<
"LogicError: Deadlock detected. Deadlocked time: "
165 << timeSpentDeadlocked.count() <<
"s";
177 JLOG(
journal_.
info()) <<
"Raising local fee (JQ overload): "