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();
120 auto const armed =
armed_;
125 auto const timeSpentDeadlocked =
126 duration_cast<seconds>(steady_clock::now() - deadLock);
128 constexpr
auto reportingIntervalSeconds = 10s;
129 constexpr
auto deadlockFatalLogMessageTimeLimit = 90s;
130 constexpr
auto deadlockLogicErrorTimeLimit = 600s;
131 if (armed && (timeSpentDeadlocked >= reportingIntervalSeconds))
135 if ((timeSpentDeadlocked % reportingIntervalSeconds) == 0s)
137 if (timeSpentDeadlocked < deadlockFatalLogMessageTimeLimit)
140 <<
"Server stalled for "
141 << timeSpentDeadlocked.count() <<
" seconds.";
146 <<
"Deadlock detected. Deadlocked time: "
147 << timeSpentDeadlocked.count() <<
"s";
160 if (timeSpentDeadlocked >= deadlockLogicErrorTimeLimit)
163 <<
"LogicError: Deadlock detected. Deadlocked time: "
164 << timeSpentDeadlocked.count() <<
"s";