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

Đang mở
#39,798 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@juliusmarminge đang làm issue này rồi.

Từ ngày 20/11/2026.

  • #39802 của @juliusmarminge — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
node.js, typescript
Lĩnh vực
backend, networking

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
24.8k
Fork
6.4k
Merge trung bình
4 giờ 29 phút
Pull request đã merge (30 ngày)
488

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pingdotgg/t3code

Tất cả issue của pingdotgg/t3code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.