ipc (Windows): a server shutdown discards bytes the client has not read (hostd raw terminals may lose the last output)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 69/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- rust
- 领域
- backend, networking
调研方向
Start in the Windows implementation of atlas_core::ipc's Stream::Server::poll_shutdown and inspect how it calls NamedPipeServer::disconnect(). Check the Win32 pipe shutdown behavior and add a bounded wait for the client to read the pending bytes or close. Add a cfg(windows) IPC test where a slow client reads all N bytes before EOF; verify it passes, including the existing broken-pipe EOF handling.
由索引模型根据 Issue 内容生成。
描述
What
On Windows, atlas_core::ipc's server end discards data the client has not read yet when it shuts down. Stream::Server::poll_shutdown calls NamedPipeServer::disconnect() (DisconnectNamedPipe), and per the Win32 docs that discards anything still in the pipe buffer unless the server first waits for the client (FlushFileBuffers) or for it to close.
Found while fixing the Windows askpass in #525, where it made the password never arrive (3 tests failed on windows-latest: the helper read nothing).
Where else it can bite
crates/atlas-host/src/server.rs, raw terminal connections (attach_raw loop, around L1470-1483 on main at time of writing): when the PTY ends (rrx closes) the loop breaks and calls w.shutdown().await right after the last write_all. On Windows the last chunk of terminal output before the process exits can be lost for a client that has not read it yet. Not reproduced; found by reading the code.
To check: crates/atlas-desktop/src/ctl.rs:123 and debug.rs:145 write a reply and drop the stream (no explicit shutdown). Whether CloseHandle alone loses unread data was not verified.
Proposed fix
Make the semantics safe in one place instead of at each call site: on Windows, poll_shutdown of a server stream waits until the client has read what was written (or has closed) before disconnecting, with a bound. Test under cfg(windows) in ipc tests: server writes N bytes then shuts down; a slow client still reads all N bytes, then EOF. #525 already maps ERROR_BROKEN_PIPE/ERROR_PIPE_NOT_CONNECTED to EOF on the sync client.
- 主要语言
- Rust
- 星标
- 3
- 派生
- 1
- 平均合并
- 9 小时 51 分钟
- 30 天内合并 PR
- 310
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codeatlasdev/atlas 的其他 Issue
-
type: bug
难度 2/5 1-3 小时 新手友好度 75/100
codeatlasdev/atlas#597 ·
维护者通常 1 天内回复
-
area: ci os: linux type: bug
难度 2/5 1-3 小时 新手友好度 78/100
codeatlasdev/atlas#496 ·
维护者通常 1 天内回复
-
area: ci type: bug
难度 3/5 1-2 天 新手友好度 68/100
codeatlasdev/atlas#596 ·
维护者通常 1 天内回复
-
os: linux type: bug
难度 3/5 1-2 天 新手友好度 68/100
codeatlasdev/atlas#591 ·
维护者通常 1 天内回复
-
area: ci os: windows type: bug
难度 3/5 1-2 天 新手友好度 56/100
codeatlasdev/atlas#550 · 1 条评论 ·
维护者通常 1 天内回复
查看 codeatlasdev/atlas 的全部 Issue
相似的 Issue
-
marketing
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
kinqsradio/orbyn-engineering#729 ·
-
Plans page scenario races Shift+Tab against the plan list being drawn again in Firefox and WebKit未关闭bug
难度 2/5 1-3 小时 新手友好度 83/100
nledford/Ladderback#1091 ·
维护者通常 1 天内回复
-
bug fix packaging ui user-sprint
难度 2/5 1-3 小时 新手友好度 78/100
Vondor/KassenSturz#1197 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复