"No circuits are opened" messages with onion services
If a Tor instance is only doing onion service activity, and circuits time out, then the Tor client thinks that circuits aren't opened and gives them a full minute to complete. It also complains about this in the logs at notice level, like this:
Aug 06 02:55:30.000 [notice] No circuits are opened. Relaxed timeout for circuit 21570 (a Hidden service: Pre-built vanguard circuit 4-hop circuit in state doing handshakes with channel state open) to 60000ms. However, it appears the circuit has timed out anyway.
The fix is simple. circuit_any_opened_circuits() in circuitlist.c is only counting circuits as opened if they use the DEFAULT_ROUTE_LEN. We just need to count >= DEFAULT_ROUTE_LEN to count them.