From 355a7b04a8e8abeea108af82246449859ea9fb7e Mon Sep 17 00:00:00 2001 From: Joseph Busch Date: Thu, 18 Jul 2019 13:02:34 -0500 Subject: [PATCH] Add a LogicError when a deadlock is detected --- src/ripple/app/main/LoadManager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ripple/app/main/LoadManager.cpp b/src/ripple/app/main/LoadManager.cpp index 600c3f24f..c13924dd7 100644 --- a/src/ripple/app/main/LoadManager.cpp +++ b/src/ripple/app/main/LoadManager.cpp @@ -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"); } }