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

If Tor is offline long enough to stop building circuits, Ricochet will never recover #245

Open
armadev opened this issue Aug 7, 2015 · 3 comments
Labels
Milestone

Comments

Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
@armadev
Copy link

@armadev armadev commented Aug 7, 2015

Run ricochet, have it bootstrap Tor just fine. Then go offline for a while, then close your laptop for a while. When it comes back, if you've waited long enough, Tor will no longer have any "predicted ports", meaning any_predicted_circuits() returns 0, meaning Tor will fetch new consensuses, but it has stopped building preemptive circuits. Tor will remain in this sleepy position until a new socks request arrives, at which point it will wake up and start building preemptive circuits again.

This is all fine and good, except apparently Ricochet is waiting for Tor to emit the "I've built a circuit!" event. So both sides patiently wait for each other, and the result is that Ricochet gets stuck in the "Connecting..." state.

I don't yet know if this is a Ricochet bug or a Tor bug, i.e. whether we should aim to fix this on the Tor side or the Ricochet side. What exactly does Ricochet wait for?

@special
Copy link
Member

@special special commented Aug 7, 2015

Ricochet won't attempt any new connections after a CIRCUIT_NOT_ESTABLISHED event, until the CIRCUIT_ESTABLISHED event arrives. The intent here is that we don't want to pretend contacts are offline and increase the connection attempt interval if there is no chance of the connection succeeding.

Regardless of whether it's a Tor bug, it sounds like we need a workaround or fix on the Ricochet side.

@special special added this to the 1.1.x milestone Aug 7, 2015
@armadev
Copy link
Author

@armadev armadev commented Aug 7, 2015

What would happen if you do a 'getinfo dormant' after the circuit-not-established? And then if indeed Tor has gone dormant, you'll have to wiggle something so it wakes up. (But you don't have to let the user know that you wiggled anything.)

@special
Copy link
Member

@special special commented Aug 13, 2015

I think we'd still have a problem, because tor could go dormant at some point after the circuit_not_established event. We could periodically ask tor if it's dormant, but we might not notice the connection being resumed for up to that interval.

It sounds like Ricochet should prevent tor from going dormant while circuits-established is false. It looks like making a connection every PredictedPortsRelevanceTime and after CLOCK_JUMPED, while circuits-established is false, would be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment