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