Skip to content

Attempt at introducing timeouts for new streams

George Kadianakis requested to merge asn/arti:stream_timeout into main


I started dogfooding arti with Tor Browser today (more on this in another ticket) and I noticed that when I closed my laptop and relocated, when I came back online after about 40 minutes, Tor Browser could not do any connections because arti would continuously return dead circuits to the "Looking for a circuit that ..." code.

For this reason I started working on introducing a stream timeout which could detect such cases and mark connections/circuits as closed kinda like what happens in connection_ap_expire_beginning() in little-t-tor. It tries to replicate the classic "stop loading after 120 seconds" behavior of Tor.

This branch represents my effort so far. I released-early-released-often because I wanted feedback on the logic, style and also effect. Perhaps this is not needed?

I haven't managed to test it because for this effect to be reproduced I had to take down the network for a considerable amount of time (I can't reproduce it by taking down my interface for a bunch of minutes).

Merge request reports