fix(provider/selfhosted): server-advertised max connections and fix cpu dial spin
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go
- Ambito
- backend, networking
Direzione di ricerca
Start with selfhosted.go and trace openDataConnections; compare its connection management with localtunnel.go. Then inspect internal/server/protocol/protocol.go and handleControlConnection to follow how registration responses are built. Done means the response advertises the server buffer limit, the client caps and uses that limit to manage connections, and the idle client no longer spins CPU.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
right now in selfhosted.go, openDataConnections has an infinite for loop that continuously dials the server without waiting:
for {
conn, _ := dialer.DialContext(...)
// sends TypeData
go s.proxyRequest(ctx, conn, localPort)
}
once the server buffer fills up (10 conns), the server drops conn 11. since the dial itself succeeded, err == nil, so backoff never kicks in. the client just spins in a super tight loop dialing thousands of times per second and burning 100% cpu.
we wanted to fix this while keeping the client decoupled from whatever limit the server is configured with (so if someone changes VPS buffer to 5 or 25, client doesn't need a hardcoded update).
plan / what we should do:
-
protocol:
addmax_connections(int) toTunnelResponseininternal/server/protocol/protocol.go. -
server:
inhandleControlConnection, sendMaxConnections: defaultDataConnBuffer(or whatever buffer size is set to) in the response json when registering. -
client (
selfhosted.go):
mirror howlocaltunnel.godoes it:
- read
resp.MaxConnections(clamp with a client ceiling like min(resp.MaxConnections, 30)) - instead of the infinite dial loop, use
openConnectionsto start that manyhandleConnectiongoroutines - each
handleConnectionholds 1 connection, callsproxyRequest, and only loops to redial a new one when that connection is done / closed
todo:
- add
max_connectionstoTunnelResponse - server sends its buffer size in registration response
- client uses
openConnections+handleConnectioninstead of unboundedforloop - test that idle selfhosted client doesn't spin cpu
- Lingua principale
- Go
- Stelle
- 9
- Fork
- 1
- Merge medio
- 5h 57m
- PR unite (30g)
- 15
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
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 kernelshard/expose
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
kernelshard/expose#71 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
kernelshard/expose#62 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
kernelshard/expose#58 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
kernelshard/expose#56 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
kernelshard/expose#35 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di kernelshard/expose
Issue simili
-
area/import kind/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
kind/documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
kubernetes-sigs/dra-driver-nvidia-gpu#1569 ·
I maintainer di solito rispondono entro 1 giorno
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
openclaw/openclaw-enterprise#2571 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
All resource links brokenAperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
-
[BUG] Keycloak OIDC group search fails for non-ASCII (e.g. Chinese) search terms with "unexpected end of JSON input"Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno