NetDB: Prevent rare deadlock via FloodfillMonitorJob at startup

This commit is contained in:
zzz
2022-02-22 10:06:07 -05:00
parent 63f3d88f78
commit f0ad921fd2

View File

@ -52,6 +52,13 @@ class FloodfillMonitorJob extends JobImpl {
public String getName() { return "Monitor the floodfill pool"; }
public synchronized void runJob() {
if (!getContext().commSystem().isRunning()) {
// Avoid deadlock in the transports through here via Router.rebuildRouterInfo() at startup
if (_log.shouldWarn())
_log.warn("Floodfill Monitor before comm system started");
requeue(100);
return;
}
boolean wasFF = _facade.floodfillEnabled();
boolean ff = shouldBeFloodfill();
_facade.setFloodfillEnabledFromMonitor(ff);