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

オープン
#39,798 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@juliusmarminge がすでに取り組んでいます。

2026年11月20日 から。

  • #39802 @juliusmarminge による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
node.js, typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
24.8k
フォーク
6.4k
平均マージ
4時間 29分
マージ済み PR(30日)
488

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pingdotgg/t3code のほかの issue

pingdotgg/t3code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。