Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlock fixes #10

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Deadlock fixes #10

wants to merge 1 commit into from

Conversation

str4d
Copy link

@str4d str4d commented Mar 13, 2014

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

@str4d
Copy link
Author

str4d commented Apr 26, 2014

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.

devrandom added a commit to devrandom/bitcoinj that referenced this pull request Aug 22, 2014
devrandom added a commit to devrandom/bitcoinj that referenced this pull request Aug 22, 2014
devrandom added a commit to devrandom/bitcoinj that referenced this pull request Aug 22, 2014
devrandom added a commit to devrandom/bitcoinj that referenced this pull request Aug 22, 2014
devrandom added a commit to devrandom/bitcoinj that referenced this pull request Aug 23, 2014
devrandom added a commit to devrandom/bitcoinj that referenced this pull request Aug 23, 2014
subgraph/Orchid#10

Conflicts:
	orchid/src/com/subgraph/orchid/circuits/CircuitIO.java
devrandom added a commit to devrandom/bitcoinj that referenced this pull request Aug 23, 2014
subgraph/Orchid#10

Conflicts:
	orchid/src/com/subgraph/orchid/circuits/CircuitIO.java
devrandom added a commit to devrandom/bitcoinj that referenced this pull request Aug 23, 2014
subgraph/Orchid#10

Conflicts:
	orchid/src/com/subgraph/orchid/circuits/CircuitIO.java
mikehearn pushed a commit to bitcoinj/bitcoinj that referenced this pull request Aug 23, 2014
mikehearn pushed a commit to bitcoinj/bitcoinj that referenced this pull request Aug 23, 2014
subgraph/Orchid#10

Conflicts:
	orchid/src/com/subgraph/orchid/circuits/CircuitIO.java
@devrandom
Copy link

We took a different approach to fixing the second deadlock:

https://github.com/bitcoinj/bitcoinj/pull/185/files#diff-67603e95d69927fc6117d1253dcc9dbfR152

@devrandom
Copy link

... and sorry for the notification spam, resulting from a bunch of rebases.

@devrandom
Copy link

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

devrandom added a commit to devrandom/bitcoinj that referenced this pull request Aug 23, 2014
devrandom added a commit to devrandom/bitcoinj that referenced this pull request Aug 23, 2014
mikehearn pushed a commit to bitcoinj/bitcoinj that referenced this pull request Aug 23, 2014
@mikehearn
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants