3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 15:22:16 +00:00

Orchid: document an issue with pending circuits on shutdown

This commit is contained in:
Devrandom 2014-08-24 14:41:13 -07:00 committed by Mike Hearn
parent f57c3a857c
commit b6eb96cb44
2 changed files with 9 additions and 5 deletions

View File

@ -129,20 +129,21 @@ public class CircuitManagerImpl implements CircuitManager, DashboardRenderable {
} }
void addActiveCircuit(CircuitImpl circuit) { void addActiveCircuit(CircuitImpl circuit) {
synchronized (activeCircuits) {
activeCircuits.add(circuit);
activeCircuits.notifyAll();
}
lock.lock(); lock.lock();
try { try {
if (!isBuilding) { if (!isBuilding) {
// we were asked to stop since this circuit was started
circuit.destroyCircuit(); circuit.destroyCircuit();
} }
} finally { } finally {
lock.unlock(); lock.unlock();
} }
synchronized (activeCircuits) {
activeCircuits.add(circuit);
activeCircuits.notifyAll();
}
} }
void removeActiveCircuit(CircuitImpl circuit) { void removeActiveCircuit(CircuitImpl circuit) {

View File

@ -94,6 +94,9 @@ public class ConnectionCacheImpl implements ConnectionCache, DashboardRenderable
logger.warning("Exception closing connection: "+ e.getCause()); logger.warning("Exception closing connection: "+ e.getCause());
} }
} else { } else {
// FIXME this doesn't close the socket, so the connection task lingers
// A proper fix would require maintaining pending connections in a separate
// collection.
f.cancel(true); f.cancel(true);
} }
} }