[Bug]: One 5s readiness-probe miss tears down a working SSH tunnel, so a briefly slow remote shows "reconnecting" loops

Aberta
#39,798 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@juliusmarminge já está trabalhando nisso.

Desde 20/11/2026.

  • #39802 de @juliusmarminge — aberto

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
25/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
node.js, typescript
Domínio
backend, networking

Direção de pesquisa

Read packages/ssh/src/tunnel.ts, especially ensureTunnelEntry and the readiness timeout handling. Check how waitForHttpReady distinguishes timeouts from a refused local port and an exited ssh -L process; the linked pull request #39802 is already addressing this issue. Done means a slow, live server keeps its tunnel while a dead tunnel is recreated.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Version: desktop 0.1.11-nightly.20261118.4890. Remote is a Linux VM over SSH whose disk sometimes stalls fsync for tens of seconds.

What happened

The remote environment showed "<host> is reconnecting" every few minutes. Every time, ssh/tunnel.ensureTunnelEntry probed the existing tunnel, got SshReadinessError: Timed out waiting 5000ms for backend readiness, closed the tunnel, and ran the full SSH launch again. The server was alive and unchanged throughout (same pid for the whole period). It was briefly slow, with event-loop stalls of 2–150 s recorded in event-loop-stalls.ndjson.

Cause

In packages/ssh/src/tunnel.ts, ensureTunnelEntry runs one waitForHttpReady with SSH_TUNNEL_READY_PROBE_TIMEOUT_MS = 5_000 against the existing forward. On any failure it deletes the entry and calls closeTunnelEntry, then createTunnelEntry. The new launch hits the same slow server, so it adds SSH round-trips and a second readiness wait instead of helping. It can also fail outright, for example with "still running but did not become ready" or a banner-exchange timeout while the host is stalled.

Expected

A slow but alive server keeps its tunnel. One way to get there:

  • Treat a probe timeout as "server slow": keep the forward and retry with backoff.
  • Recreate the forward only when the local port is refused or the ssh -L process has exited, meaning the tunnel itself is dead.

Created with Claude Opus 5.5 in Claude Code.

Linguagem predominante
TypeScript
Estrelas
24.8k
Forks
6.4k
Merge médio
4h 29min
PRs com merge (30d)
488

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de pingdotgg/t3code

Todas as issues de pingdotgg/t3code

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.