Orchid
Orchid copied to clipboard
Deadlock fixes
We have packaged Orchid as an I2P plugin, enabling I2P users to easily use Orchid as an outproxy for their non-I2P web connections. This is the first patch we are pushing upstream for bugs we have found. The patch is in the current released version of the Orchid plugin.
Ref: https://trac.i2p2.de/ticket/1207
We have found another deadlock, caused in part by the fix for the previous one. I have a patch for it, but we are not certain whether it is entirely correct.
We took a different approach to fixing the second deadlock:
https://github.com/bitcoinj/bitcoinj/pull/185/files#diff-67603e95d69927fc6117d1253dcc9dbfR152
... and sorry for the notification spam, resulting from a bunch of rebases.
Found another similar one - this time CircuitIO against ConnectionImpl.
com.google.common.util.concurrent.CycleDetectingLockFactory$PotentialDeadlockException: stream -> circuits, circuits -> stream
at com.google.common.util.concurrent.CycleDetectingLockFactory$CycleDetectingReentrantLock.lock(CycleDetectingLockFactory.java:817)
at com.subgraph.orchid.connections.ConnectionImpl.removeCircuit(ConnectionImpl.java:342)
at com.subgraph.orchid.circuits.CircuitIO.destroyCircuit(CircuitIO.java:300)
at com.subgraph.orchid.circuits.CircuitImpl.destroyCircuit(CircuitImpl.java:232)
at com.subgraph.orchid.circuits.CircuitManagerImpl.stopBuildingCircuits(CircuitManagerImpl.java:101)
at com.subgraph.orchid.TorClient.stop(TorClient.java:98)
at com.google.bitcoin.core.PeerGroup.shutDown(PeerGroup.java:810)
at com.google.common.util.concurrent.AbstractExecutionThreadService$1$2.run(AbstractExecutionThreadService.java:73)
at com.google.common.util.concurrent.Callables$3.run(Callables.java:93)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.google.common.util.concurrent.CycleDetectingLockFactory$ExampleStackTrace: circuits -> stream
at com.google.common.util.concurrent.CycleDetectingLockFactory$CycleDetectingReentrantLock.lock(CycleDetectingLockFactory.java:817)
at com.subgraph.orchid.circuits.CircuitIO.processRelayDataCell(CircuitIO.java:177)
at com.subgraph.orchid.circuits.CircuitIO.deliverRelayCell(CircuitIO.java:148)
at com.subgraph.orchid.circuits.CircuitImpl.deliverRelayCell(CircuitImpl.java:216)
at com.subgraph.orchid.connections.ConnectionImpl.processRelayCell(ConnectionImpl.java:299)
at com.subgraph.orchid.connections.ConnectionImpl.processCell(ConnectionImpl.java:268)
at com.subgraph.orchid.connections.ConnectionImpl.readCellsLoop(ConnectionImpl.java:239)
at com.subgraph.orchid.connections.ConnectionImpl.access$000(ConnectionImpl.java:46)
at com.subgraph.orchid.connections.ConnectionImpl$1.run(ConnectionImpl.java:228)
... 1 more
The deadlock fixes from bitcoinj have been merged. This can be closed now - we haven't seen any deadlocks in Orchid for a long time after these fixes.