meejah / txtorcon

Twisted-based asynchronous Tor control protocol implementation. Includes unit-tests, examples, state-tracking code and configuration abstraction.
http://fjblvrw2jrxnhtg67qpbzi45r7ofojaoo3orzykesly2j3c2m3htapid.onion/
MIT License
250 stars 72 forks source link

Wake up Tor on "552 no descriptor for X" #251

Open meejah opened 7 years ago

meejah commented 7 years ago

If Tor is dormant and txtorcon connects and tries to build a circuit, this may fail with 552 no descriptor for X because Tor still fetches enough consensus to know about new/current relays, but doesn't fetch (micro)descriptors if it is dormant.

GETINFO dormant will tell us if Tor is dormant. So: if there's a .build call in progress, and we get a 552, and Tor is dormant, we should wake it up. Recommended way to do this is to resolve a DNS or try to connect to soemthing (e.g. we could do a lookup for torproject.org via SOCKS).

Thanks to arma and teor on #tor-dev for discussion