tailscale/cmd
Brad Fitzpatrick 91c9c33036 cmd/tailscaled: don't block ipnserver startup behind engine init on Windows
With this change, the ipnserver's safesocket.Listen (the localhost
tcp.Listen) happens right away, before any synchronous
TUN/DNS/Engine/etc setup work, which might be slow, especially on
early boot on Windows.

Because the safesocket.Listen starts up early, that means localhost
TCP dials (the safesocket.Connect from the GUI) complete successfully
and thus the GUI avoids the MessageBox error. (I verified that
pacifies it, even without a Listener.Accept; I'd feared that Windows
localhost was maybe special and avoided the normal listener backlog).

Once the GUI can then connect immediately without errors, the various
timeouts then matter less, because the backend is no longer trying to
race against the GUI's timeout. So keep retrying on errors for a
minute, or 10 minutes if the system just booted in the past 10
minutes.

This should fix the problem with Windows 10 desktops auto-logging in
and starting the Tailscale frontend which was then showing a
MessageBox error about failing to connect to tailscaled, which was
slow coming up because the Windows networking stack wasn't up
yet. Fingers crossed.

Fixes #1313 (previously #1187, etc)

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-04-20 22:26:27 -07:00
..
cloner all: adjust Unix permissions for those without umasks 2021-01-11 19:24:41 -08:00
derper cmd/derper: add /bootstrap-dns handler 2021-02-26 09:29:28 -08:00
hello client/tailscale/apitype: move local API types to new apitype package 2021-04-13 08:13:46 -07:00
microproxy cmd/microproxy: add -insecure flag 2020-09-15 15:07:56 -07:00
mkpkg cmd/mkpkg: support adding empty directories. 2020-05-04 17:57:13 -04:00
tailscale cmd/tailscale/cli: relax & improve the running-as-CLI check for macOS 2021-04-20 09:18:33 -07:00
tailscaled cmd/tailscaled: don't block ipnserver startup behind engine init on Windows 2021-04-20 22:26:27 -07:00
tsshd net/interfaces: remove IsTailscaleIP, make callers use tsaddr. 2021-01-26 15:10:51 -08:00