mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-22 03:55:53 +00:00
Report job queue data if a deadlock is detected
This commit is contained in:
@@ -107,14 +107,13 @@ LoadManager::run()
|
||||
auto t = clock_type::now();
|
||||
|
||||
while (true)
|
||||
{
|
||||
{
|
||||
t += 1s;
|
||||
|
||||
std::unique_lock sl(mutex_);
|
||||
if (cv_.wait_until(sl, t, [this] { return stop_; }))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// Copy out shared data under a lock. Use copies outside lock.
|
||||
auto const deadLock = deadLock_;
|
||||
auto const armed = armed_;
|
||||
@@ -128,6 +127,7 @@ LoadManager::run()
|
||||
constexpr auto reportingIntervalSeconds = 10s;
|
||||
constexpr auto deadlockFatalLogMessageTimeLimit = 90s;
|
||||
constexpr auto deadlockLogicErrorTimeLimit = 600s;
|
||||
|
||||
if (armed && (timeSpentDeadlocked >= reportingIntervalSeconds))
|
||||
{
|
||||
// Report the deadlocked condition every
|
||||
@@ -137,19 +137,20 @@ LoadManager::run()
|
||||
if (timeSpentDeadlocked < deadlockFatalLogMessageTimeLimit)
|
||||
{
|
||||
JLOG(journal_.warn())
|
||||
<< "Server stalled for "
|
||||
<< timeSpentDeadlocked.count() << " seconds.";
|
||||
<< "Server stalled for " << timeSpentDeadlocked.count()
|
||||
<< " seconds.";
|
||||
if (app_.getJobQueue().isOverloaded())
|
||||
{
|
||||
JLOG(journal_.warn()) << app_.getJobQueue().getJson(0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
JLOG(journal_.fatal())
|
||||
<< "Deadlock detected. Deadlocked time: "
|
||||
<< timeSpentDeadlocked.count() << "s";
|
||||
if (app_.getJobQueue().isOverloaded())
|
||||
{
|
||||
JLOG(journal_.fatal())
|
||||
<< app_.getJobQueue().getJson(0);
|
||||
}
|
||||
<< "JobQueue: " << app_.getJobQueue().getJson(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,19 +163,19 @@ LoadManager::run()
|
||||
JLOG(journal_.fatal())
|
||||
<< "LogicError: Deadlock detected. Deadlocked time: "
|
||||
<< timeSpentDeadlocked.count() << "s";
|
||||
if (app_.getJobQueue().isOverloaded())
|
||||
{
|
||||
JLOG(journal_.fatal()) << app_.getJobQueue().getJson(0);
|
||||
}
|
||||
JLOG(journal_.fatal())
|
||||
<< "JobQueue: " << app_.getJobQueue().getJson(0);
|
||||
LogicError("Deadlock detected");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool change = false;
|
||||
bool change;
|
||||
|
||||
if (app_.getJobQueue().isOverloaded())
|
||||
{
|
||||
JLOG(journal_.info()) << app_.getJobQueue().getJson(0);
|
||||
JLOG(journal_.info()) << "Raising local fee (JQ overload): "
|
||||
<< app_.getJobQueue().getJson(0);
|
||||
change = app_.getFeeTrack().raiseLocalFee();
|
||||
}
|
||||
else
|
||||
@@ -188,7 +189,6 @@ LoadManager::run()
|
||||
// subscribe in NetworkOPs or Application.
|
||||
app_.getOPs().reportFeeChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user