Another deadlock fix: remove sync in Router.isHidden()

This commit is contained in:
zzz
2015-12-12 13:21:29 +00:00
parent 89bdbedc0f
commit cddc1b362e
3 changed files with 16 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2015-12-12 zzz
* Router:
- Add family public key to router info (ticket #1510)
- More deadlock prevention (ticket #1722)
2015-12-11 zzz 2015-12-11 zzz
* Logs: Windows line ending fixes * Logs: Windows line ending fixes
* Router: * Router:

View File

@ -852,6 +852,7 @@ public class Router implements RouterClock.ClockShiftListener {
Properties stats = _context.statPublisher().publishStatistics(); Properties stats = _context.statPublisher().publishStatistics();
ri.setOptions(stats); ri.setOptions(stats);
// deadlock thru createAddresses() thru SSU REA... move outside lock?
ri.setAddresses(_context.commSystem().createAddresses()); ri.setAddresses(_context.commSystem().createAddresses());
SigningPrivateKey key = _context.keyManager().getSigningPrivateKey(); SigningPrivateKey key = _context.keyManager().getSigningPrivateKey();
@ -1002,16 +1003,18 @@ public class Router implements RouterClock.ClockShiftListener {
} }
/* /*
* * This checks the config only. We don't check the current RI
* Warning - risk of deadlock - do not call while holding locks * due to deadlocks.
* *
*/ */
public boolean isHidden() { public boolean isHidden() {
RouterInfo ri; //RouterInfo ri;
synchronized (_routerInfoLock) { //synchronized (_routerInfoLock) {
ri = _routerInfo; // ri = _routerInfo;
} //}
if ( (ri != null) && (ri.isHidden()) ) //if ( (ri != null) && (ri.isHidden()) )
// return true;
if (_context.getBooleanProperty(PROP_HIDDEN))
return true; return true;
String h = _context.getProperty(PROP_HIDDEN_HIDDEN); String h = _context.getProperty(PROP_HIDDEN_HIDDEN);
if (h != null) if (h != null)

View File

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