Skip to content

fix(ostool): tolerate closed serial bridge consumer#137

Merged
ZR233 merged 1 commit into
mainfrom
codex/serial-success-cleanup
Jun 16, 2026
Merged

fix(ostool): tolerate closed serial bridge consumer#137
ZR233 merged 1 commit into
mainfrom
codex/serial-success-cleanup

Conversation

@ZR233

@ZR233 ZR233 commented Jun 16, 2026

Copy link
Copy Markdown
Member

问题

tgoskits 的 Starry self-hosted board CI 在 ostool 0.23 更新后,可能在 success matcher 已经命中之后仍然因为 serial bridge 清理阶段的本地 BrokenPipe 报错而失败。典型日志是:成功输出已经出现,但随后 runner 报 failed to write serial websocket bytes: broken pipe

修改

  • 将 serial websocket reader 写入本地 runner bridge 的 binary/text 路径收敛到 write_bridge_bytes
  • 当本地 runner consumer 已经关闭导致 write_allflush 返回 BrokenPipe 时,将其视为本地终端已经结束读取,正常退出 reader task。
  • 其他写入错误仍继续向外返回,writer task 发往 websocket server 的错误也保持原有严格传播。
  • 添加回归测试覆盖本地 consumer 提前关闭后 reader task/shutdown 正常完成的场景。

验证

  • cargo fmt --all
  • cargo fmt --all -- --check
  • cargo test -p ostool serial_stream -- --nocapture
  • cargo test -p ostool -- --nocapture
  • cargo test -p ostool --all-features -- --nocapture
  • cargo clippy -p ostool --all-targets --all-features -- -D warnings
  • cargo build --target x86_64-unknown-linux-gnu --all-features
  • cargo clippy --target x86_64-unknown-linux-gnu --all-features
  • cargo test --target x86_64-unknown-linux-gnu --all-features -- --nocapture

未做真实硬件板卡验证;本 PR 只修复 ostool 本地 serial bridge 关闭路径。

@ZR233 ZR233 marked this pull request as ready for review June 16, 2026 07:48
@ZR233 ZR233 merged commit 55e8e01 into main Jun 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant