Add a LogicError when a deadlock is detected

This commit is contained in:
Joseph Busch
2019-07-18 13:02:34 -05:00
committed by Manoj doshi
parent d3ee0df93a
commit 355a7b04a8

View File

@@ -134,11 +134,15 @@ void LoadManager::run ()
<< timeSpentDeadlocked.count() << " seconds.";
}
// If we go over 500 seconds spent deadlocked, it means that
// If we go over 90 seconds spent deadlocked, it means that
// the deadlock resolution code has failed, which qualifies
// as undefined behavior.
//
assert (timeSpentDeadlocked < 500s);
constexpr auto deadlockTimeLimit = 90s;
assert (timeSpentDeadlocked < deadlockTimeLimit);
if (timeSpentDeadlocked >= deadlockTimeLimit)
LogicError("Deadlock detected");
}
}