SSU: Fix deadlock with router restart

http://zzz.i2p/topics/3036
This commit is contained in:
zzz
2021-01-20 09:27:55 -05:00
parent 74a9193ba5
commit 922178b2c7
3 changed files with 46 additions and 3 deletions

View File

@ -1,3 +1,22 @@
2021-01-20 zzz
* Console: Fix link to UPnP status
* SSU: Fix deadlock with router restart
2021-01-14 zzz
* Router:
- Change default encryption type to ECIES-X25519 (proposal 156)
- Move Sybil subsystem from console to router
- Limit max addresses in RI
2021-01-13 zzz
* Jetty: Fix URI in request logs
2021-01-12 zzz
* i2psnark: Don't decrement downloaded counter after receiving bad piece
2021-01-11 zzz
* Console: Delete rrd files for no-longer-configured stats at startup
2021-01-08 zzz
* i2ptunnel: Disable shared clients (DSA) (part 2)
* SSU: Fix bandwidth estimator deadlock (ticket #2798)

View File

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

View File

@ -2455,7 +2455,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
// warning, this calls back into us with allowRebuildRouterInfo = false,
// via CSFI.createAddresses->TM.getAddresses()->updateAddress()->REA
if (allowRebuildRouterInfo)
_context.router().rebuildRouterInfo();
rebuildRouterInfo();
} else {
addr = null;
}
@ -2510,11 +2510,35 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
// warning, this calls back into us with allowRebuildRouterInfo = false,
// via CSFI.createAddresses->TM.getAddresses()->updateAddress()->REA
if (allowRebuildRouterInfo)
_context.router().rebuildRouterInfo();
rebuildRouterInfo();
}
}
}
/**
* Avoid deadlocks part 999
* @since 0.9.49
*/
private void rebuildRouterInfo() {
(new RebuildEvent()).schedule(0);
}
/**
* @since 0.9.49
*/
private class RebuildEvent extends SimpleTimer2.TimedEvent {
/**
* Caller must schedule
*/
public RebuildEvent() {
super(_context.simpleTimer2());
}
public void timeReached() {
_context.router().rebuildRouterInfo(true);
}
}
/**
* Simple fetch of stored IP and port, since
* we don't put them in the real, published RouterAddress anymore