ooni / netx

OONI's Go net and net/http extensions for performing network measurements
https://ooni.org
BSD 3-Clause "New" or "Revised" License
7 stars 2 forks source link

Calibration of timeouts and retries #29

Closed bassosimone closed 4 years ago

bassosimone commented 5 years ago

As discussed with @xhdix in https://github.com/ooni/netx/pull/28#discussion_r336553305 and subsequently in private, there is a bunch of places where we need to calibrate timeouts and retries. Chiefly: when connecting, when dealing with DNS.

bassosimone commented 4 years ago

Reference issue: https://github.com/ooni/probe-engine/issues/88

bassosimone commented 4 years ago

I spent some more time trying to understand whether I did this correctly. It seems so, because we have now bounded, large timeouts for DNS, which is functional to run with bad networks.

The runtime becomes very large in case of timeouts, but then I guess we could set a global context deadline to keep each URL measurement bounded. So, the combination of large individual operation timeouts (e.g. 30 seconds to connect) and tight deadline for URL measurements (e.g. 45 seconds for a measurements) should give unreliable networks some time to breathe.

BTW this investigation also resulted in https://github.com/ooni/netx/pull/114