A client that restarts with the same node key takes about 5 s to connect
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 24/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- networking
Direzione di ricerca
Read onMeow in tailcat.go (around line 1821 on v0.8.0 and main) and the early return for an already-known client key, then follow discoPrivateForNode to see how the client's disco key is derived from its node key. On the magicsock side, trace what happens to the cached endpoint when the netmap's DiscoKey changes, since that is the path trust the fix relies on. The author has a working fix and test and intends to open a PR, so confirm with them before starting; done means a restarted client connects in a few hundred ms and repeated Ping() within one client keeps its disco key.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I use tailcat as a library with a saved client key, so the server can allowlist it. Each request starts a new client process. When a new process connects soon after the previous one, the connect takes over 5 s instead of a few hundred ms.
Measured with v0.8.0 against one long-running server through a DERP relay, 5 connects back to back and then one after 20 s idle: 416 ms, 10.7 s, then 5.4 to 5.7 s, and 5.6 s after the idle gap. In-process with a local DERP and STUN server: 3.1 s for the first, then 5.07 to 5.36 s for each restart.
What I see in the logs:
- The client's disco key is derived from its node key (
discoPrivateForNode), so every process with the same key file has the same disco key. - On the server,
onMeowreturns early for a client key it already knows (tailcat.go:1821 in v0.8.0, the same on main), before the AllowClient hook. The netmap and the magicsock endpoint stay as they were. - magicsock still trusts the old process's direct UDP address. The server sends its WireGuard handshake response there and it is lost.
- The client retries after WireGuard's 5 s handshake timeout, and by then the server has found the new path.
The fix that works for me:
- A client gets a fresh disco key for each
Client. The server keeps deriving its disco key from its node key, since that key is part of its address. - When a known client sends a meow with a different disco key,
onMeowupdatesDiscoKeyon a clone of the node and pushes the new netmap. magicsock then drops its trust in the old path, and replies go through DERP until the new direct path is found. A known client was already admitted, so this path doesn't call AllowClient again, the same as today.
With that change the same relay sequence gives 489 ms, 1.3 s, then 335 to 383 ms, and 371 ms after 20 s idle. In-process: 3.1 s for the first, then 109 to 125 ms. Repeated Ping() calls inside one client keep the same disco key, so they don't reset a good path.
A fix with a test is ready; I'll open a PR that references this issue.
- Lingua principale
- Go
- Stelle
- 10.1k
- Fork
- 470
- Merge medio
- 1g 14h
- PR unite (30g)
- 19
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tailscale/tailcat
-
Update Tailscale dependency for Android cgo fallback fixForse già presa @lozbrown l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Shring the homebrew binariesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 40/100
tailscale/tailcat#200 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
tailscale/tailcat#190 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di tailscale/tailcat
Issue simili
-
[bug] Explorer trims leading spaces on file namesForse già presa @unshade l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
mickael-kerjean/filestash#1033 · 1 commento ·
-
[BUG] HTTP remote call timeouts can be returned as 500Forse già presa @XnLemon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
apache/dubbo-go-pixiu#1096 ·
I maintainer di solito rispondono entro 1 giorno
-
conversation: ConverseAlpha1 and ConverseAlpha2 panic on empty choices or nil function call and return misleading error on scrubber failureForse già presa @patelshivani2283-lab l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
meta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
last9/last9-mcp-server#640 ·
I maintainer di solito rispondono entro 1 giorno