From 6a3dc67e9b434c58af7026378eda7b728448a5ab Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 4 Jun 2021 11:36:57 -0400 Subject: [PATCH] nuke from orbit style router profiling for path build timeouts. * when a path build times out, shitlist every router in the path except the first hop, this way eventually we get the nodedb pruned to only the routers that are currently actually alive, any ones we nuke that we need later we can always do lookups for. --- llarp/path/pathbuilder.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/llarp/path/pathbuilder.cpp b/llarp/path/pathbuilder.cpp index 28c7a226e..482748356 100644 --- a/llarp/path/pathbuilder.cpp +++ b/llarp/path/pathbuilder.cpp @@ -477,6 +477,17 @@ namespace llarp m_router->routerProfiling().MarkPathTimeout(p.get()); PathSet::HandlePathBuildTimeout(p); DoPathBuildBackoff(); + bool firstHop = true; + for (const auto& hop : p->hops) + { + if (not firstHop) + { + RouterID router{hop.rc.pubkey}; + LogWarn(Name(), " removing router ", router, " because of path build timeout"); + m_router->nodedb()->Remove(router); + } + firstHop = false; + } } void