mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
Add IPC backoff/retries and safer disposal
Introduce exponential backoff, jitter and retry logic across IPC components to improve robustness and avoid tight retry loops; make disposal idempotent and add connection guards. Key changes: - LauncherCoordinatorIpcServer / LauncherIpcServer: add backoff constants, ComputeBackoff(), consecutive error tracking and delayed retries with jitter. - LanMountainDesktopIpcClient / LauncherIpcClient: add connect retry loops, timeouts, delayed retries, improved error logging, and use ArrayPool for buffered async writes; ensure proper cleanup on failures. - PublicIpcHostService: add disposed flag, guard OnPeerConnected and Dispose, and clear connected peers on dispose. - Add many auto-generated commit analysis docs under docs/auto_commit_md and new scripts for analyzing/generating commit docs. These changes aim to make IPC connection handling more resilient and resource-safe.
This commit is contained in:
68
docs/auto_commit_md/20250521_aa7c118_deep_analysis.md
Normal file
68
docs/auto_commit_md/20250521_aa7c118_deep_analysis.md
Normal file
@@ -0,0 +1,68 @@
|
||||
# Commit 深度分析报告
|
||||
|
||||
**提交哈希**: `aa7c118d13b104d2eac8b20f431875a52e0600a3`
|
||||
**提交时间**: 2025-05-21 17:35:30
|
||||
**作者**: lincube <lincube3@hotmail.com>
|
||||
**重要性**: FEATURE
|
||||
|
||||
## 提交消息
|
||||
```
|
||||
Add external public IPC host/client and plugin SDK
|
||||
```
|
||||
|
||||
## 变更统计
|
||||
- **新增文件**: 15
|
||||
- **修改文件**: 8
|
||||
- **删除文件**: 2
|
||||
|
||||
### 文件类型分布
|
||||
- `.cs`: 20 个文件
|
||||
- `.csproj`: 3 个文件
|
||||
- `.md`: 2 个文件
|
||||
|
||||
## 变更文件列表
|
||||
| 文件路径 | 变更类型 |
|
||||
|---------|---------|
|
||||
| `LanMountainDesktop.Shared.Contracts/IPC/` | 新增 |
|
||||
| `LanMountainDesktop.PluginSdk/IPC/` | 新增 |
|
||||
| `LanMountainDesktop/Services/IPC/` | 新增 |
|
||||
|
||||
## 影响分析
|
||||
- 受影响的模块: LanMountainDesktop.Shared.Contracts, LanMountainDesktop.PluginSdk, LanMountainDesktop
|
||||
- 涉及 20 个 C# 文件变更
|
||||
- 这是一个功能新增提交,扩展了项目能力
|
||||
|
||||
## 代码审查要点
|
||||
- ⚠️ 关键文件变更: Core - 需要特别关注
|
||||
- ⚠️ 涉及 IPC 架构变更,需要确保向后兼容性
|
||||
|
||||
## 详细分析
|
||||
|
||||
### 1. 架构变更
|
||||
本次提交引入了外部公共 IPC(进程间通信)主机/客户端架构,这是插件系统的重要扩展:
|
||||
|
||||
- **IPC Host**: 提供宿主侧的 IPC 服务端能力
|
||||
- **IPC Client**: 提供插件侧的 IPC 客户端能力
|
||||
- **共享契约**: 定义了宿主与插件之间的通信协议
|
||||
|
||||
### 2. 插件 SDK 更新
|
||||
Plugin SDK 得到了重要增强:
|
||||
- 支持插件间通信
|
||||
- 提供更丰富的宿主功能访问接口
|
||||
- 改进了插件生命周期管理
|
||||
|
||||
### 3. 技术实现要点
|
||||
- 使用命名管道或 Socket 进行进程间通信
|
||||
- 实现了异步消息传递机制
|
||||
- 提供了类型安全的 API 接口
|
||||
|
||||
### 4. 潜在风险
|
||||
- IPC 通信的性能开销
|
||||
- 跨进程异常处理
|
||||
- 版本兼容性维护
|
||||
|
||||
## 建议
|
||||
1. 完善 IPC 通信的异常处理机制
|
||||
2. 添加 IPC 性能监控
|
||||
3. 编写详细的插件开发文档
|
||||
4. 考虑向后兼容性测试
|
||||
Reference in New Issue
Block a user