Router: Prevent deadlock at startup

in the transports through PLRIJ via FNDF.publish()
This commit is contained in:
zzz
2022-01-06 07:18:42 -05:00
parent 150248d8d7
commit 7f4441078d
5 changed files with 34 additions and 1 deletions

View File

@ -1,3 +1,20 @@
2022-01-06 zzz
* Router: Prevent deadlock at startup
2022-01-05 zzz
* Plugins:
- Fix console icon when consoleLinkURL is specified
and different from the plugin name
- Fix webapp classpath setting when the webapp name
is different from the plugin name
2022-01-04 zzz
* i2pcontrol: Send translated tunnel status string
2022-01-02 zzz
* i2pcontrol: Handle more router states mapping to i2pcontrol states
* i2ptunnel: Add hooks to get the session from the contoller
2021-12-28 zzz 2021-12-28 zzz
* Console: Partial string case-insensitive match for netdb family search * Console: Partial string case-insensitive match for netdb family search
* i2ptunnel: Add IRC filter support for IRCv3 message tags * i2ptunnel: Add IRC filter support for IRCv3 message tags

View File

@ -176,6 +176,9 @@ public abstract class CommSystemFacade implements Service {
/** @since 0.8.13 */ /** @since 0.8.13 */
public boolean isDummy() { return true; } public boolean isDummy() { return true; }
/** @since 0.9.53 */
public boolean isRunning() { return true; }
/** /**
* Tell other transports our address changed * Tell other transports our address changed
*/ */

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Git"; public final static String ID = "Git";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 7; public final static long BUILD = 8;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";

View File

@ -69,6 +69,13 @@ public class PublishLocalRouterInfoJob extends JobImpl {
public String getName() { return "Publish Local Router Info"; } public String getName() { return "Publish Local Router Info"; }
public void runJob() { public void runJob() {
if (!getContext().commSystem().isRunning()) {
// Avoid deadlock in the transports through here via FNDF.publish() at startup
if (_log.shouldWarn())
_log.warn("PLRIJ before comm system started");
requeue(100);
return;
}
long last = getContext().netDb().getLastRouterInfoPublishTime(); long last = getContext().netDb().getLastRouterInfoPublishTime();
long now = getContext().clock().now(); long now = getContext().clock().now();
if (last + MIN_PUBLISH_DELAY > now) { if (last + MIN_PUBLISH_DELAY > now) {

View File

@ -86,6 +86,12 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
else else
_manager.restart(); _manager.restart();
} }
/**
* @since 0.9.53
*/
@Override
public synchronized boolean isRunning() { return _wasStarted; }
/** /**
* How many peers are we currently connected to, that we have * How many peers are we currently connected to, that we have