[Bug]: SSH reconnect fails for as long as the old remote server is stuck shutting down
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- backend, networking
调研方向
Start with the reconnect launch script in packages/ssh/src/tunnel.ts, especially the managed_server_running check and wait_ready path. Trace how the remote server's runtime record and shutdown lifecycle are handled, including the mentioned releaseManagedTunnelOnShutdown path. Run the SSH reconnect tests and add coverage for a live server whose listener has closed; done means reconnect recovers or reports the previous process is still shutting down.
由索引模型根据 Issue 内容生成。
描述
Version: desktop and remote runtime 0.1.11-nightly.20261118.4890. Remote is an arm64 Linux VM reached over SSH.
What happened
The remote t3 serve process received SIGTERM and began shutting down. It closed its HTTP listener, but it could not exit, because one of its worker threads was blocked in an uninterruptible filesystem wait (a slow fsync on the VM). For the next ~22 minutes, every reconnect from the desktop failed with:
Remote T3 server is still running but did not become ready. Retry the connection; the server was left running.
Each retry spent about 70 s inside launchOrReuseRemoteServer before failing. The connection came back only after the old process finally exited.
Cause
In packages/ssh/src/tunnel.ts, the launch script checks managed_server_running "$REMOTE_PID", which tests only kill -0 plus the process's command line. A server that is mid-shutdown passes that check. The script then runs wait_ready, which can never succeed because the listener is closed, and the script exits 1 with "the server was left running". Nothing in the reconnect path can tell "alive but slow" apart from "alive but shutting down", so the desktop retries the same failing path indefinitely.
Observed on the remote during the outage:
- The pid was alive in state
S. Its main thread was inepoll_pwaitand oneWorkerThreadwas inD(wait_for_commit). curl http://127.0.0.1:3773/was refused immediately (no listener).- The trace showed
environment.cloud.releaseManagedTunnelOnShutdownand the rootserver.runServerCommandfibers being interrupted, so teardown had started but not finished.
Expected
The reconnect either recovers or reports what is actually wrong. Options:
- The server marks its runtime record as stopping when teardown begins, and the launcher treats a stopping server as gone: it waits a bounded time, then starts a fresh server or fails with "the previous server (pid N) is still shutting down".
- At minimum, when the port is refused (as opposed to timing out), the launcher should not say the server "did not become ready".
Created with Claude Opus 5.5 in Claude Code.
- 主要语言
- TypeScript
- 星标
- 24.8k
- 派生
- 6.4k
- 平均合并
- 4 小时 29 分钟
- 30 天内合并 PR
- 488
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pingdotgg/t3code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
needs more info
难度 2/5 1-3 小时 新手友好度 72/100
pingdotgg/t3code#39400 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug]: Wrapped PR titles lose bottom padding in the thread details panel可能已有人在做 @iamdatvt94 于 1 天前认领。 未关闭bug needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复
相似的 Issue
-
area:plugins kind:bug priority:p2 ready
难度 2/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复
-
Escaped `*` followed by `*` (`\**`) never matches可能已有人在做 @bardrop 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 71/100
editorconfig/editorconfig-core-js#172 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
vega/vega-webgpu#40 ·
-
type: bug 🐛
难度 2/5 1-3 小时 新手友好度 63/100
puckeditor/puck#1929 ·
维护者通常 1 天内回复
-
compression() compresses every response at Brotli quality 11可能已有人在做 @staylor 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复