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

Reconsider local network timeout #666

Open
Stebalien opened this issue Jun 30, 2019 · 5 comments
Open

Reconsider local network timeout #666

Stebalien opened this issue Jun 30, 2019 · 5 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@Stebalien
Copy link
Member

We currently timeout "local" dials after 5 seconds. Unfortunately, "local" latencies may actually be high (e.g. on VPNs).

See ipfs/kubo#6468.

Given that we already have a 10s timeout in the TCP transport (for the handshake), we should consider dropping this (or at least limiting it to localhost).

@raulk
Copy link
Member

raulk commented Jun 30, 2019

I’m leaning towards not generalising such a high timeout in order to cater for special cases (vpn). I think we need a dynamic timeout service that runs in the background and:

  1. senses if we’re running behind a vpn by introspecting local interfaces and some other heuristic.
  2. for private addresses, it tracks RTT across different subnet masks and sets timeouts accordingly.

For 2, I can see us starting with speculative, high timeouts as soon as we boot up, adjusting it downwards as we observe connection establishment times for subnets, and upwards when we witness timeouts (retrying those automatically to avoid false backoffs), eventually converging to appropriate values which we could then maybe share with local peers via a dedicated protocol.

@Stebalien
Copy link
Member Author

So, what do we tell users running private IPFS clusters?

@raulk
Copy link
Member

raulk commented Jul 2, 2019

That we want to design things carefully, and avoid generalising for special cases? Can IPFS add a config option to set this timeout? IIRC it’s a var in libp2p. And all timeouts should be configurable anyway.

@Stebalien
Copy link
Member Author

We could but most users will just say "ipfs doesn't work" and leave. Really, I'm not sure how useful this additional timeout is (5 seconds for undialable local peers versus 10 for all others).

@raulk
Copy link
Member

raulk commented Jul 2, 2019

The flip side of this is routers that swallow packets for unroutable local addrs. I recently had this in a public setting, and it consumed my dial queues for longer than necessary. So in this situation, I’d rather fail fast. That’s why we can’t generalise.

I’d say the average novice is more likely to be running in a setting like the one I experienced. If you’re running a private cluster over VPN, you’re slightly more advanced.

An easy tradeoff right now is to detect VPN interfaces and print a tip on stdout if the setting is not set.


EDITED @Stebalien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

2 participants