Files
markbase/data/phase16_3_ssh_server_crash.md
Warren d5d1b00a54
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled
Phase 16.3: SSH server稳定性问题诊断
测试结果:
-  5MB-20MB: 成功(MD5一致)
-  50MB-100MB: SSH server崩溃(Connection reset)

可能原因:
- stdin timeout不足(300 iterations)
- poll iteration限制(500次)
- 大文件处理问题

下一步:
- 增加stdin timeout和poll iteration限制
- 或限制传输文件大小到20MB
2026-06-17 22:44:50 +08:00

58 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Phase 16.3SSH server稳定性问题诊断
**测试时间**2026-06-17 22:43-22:45
**问题**SSH server在传输大文件50MB+)时崩溃
## 测试结果 ⭐⭐⭐⭐⭐
| 文件大小 | 传输状态 | MD5校验 | SSH server状态 | 结果 |
|---------|---------|---------|--------------|------|
| 5MB | ✅ 成功 | ✅ 一致 | ✅ 运行正常 | ✅ 成功 |
| 20MB | ✅ 成功 (19.29 MB/s) | ✅ 一致 | ✅ 运行正常 | ✅ 成功 |
| 50MB | ❌ 显示成功 | ❌ 文件不存在 | ❌ 崩溃 | ❌ 失败 |
| 100MB | ❌ Connection reset | ❌ 文件不存在 | ❌ 崩溃 | ❌ 失败 |
## 问题分析 ⭐⭐⭐⭐⭐
**症状**
- SSH server在传输50MB+文件时崩溃
- 进程消失,日志文件不存在
- Connection refused / Connection reset by peer
**可能原因**
1. stdin timeout问题300 iterations可能不够
2. poll iteration overhead500次可能太少
3. 内存问题(大文件传输时内存泄漏)
4. Child process处理问题rsync child提前退出
**关键发现**
- Window Control次数7340次5MB+20MB传输
- 这说明Window Control工作正常
- 问题可能在stdin处理或child process管理
## 诊断方案 ⭐⭐⭐⭐⭐
**方案1增加stdin timeout**(优先)
- 从300 iterations改回500或1000
- 给rsync更多时间处理大文件
**方案2增加poll iteration限制**
- 从500改回1000或2000
- 防止过早退出poll loop
**方案3添加SSH server crash handler**
- 捕获panic和error
- 防止崩溃时无日志
**方案4限制单次传输文件大小**
- 暂时限制在20MB以内
- 待后续修复后再支持大文件
---
**建议**先实施方案1+2增加timeout和iteration测试50MB是否成功
---
**最后更新**2026-06-17 22:45