Skip to content

Commit 7512079

Browse files
committed
Update audit report.
1 parent fd8ba2d commit 7512079

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

.plan/code_audit_report.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -233,27 +233,17 @@ UDP 重试间隔固定为 1 秒,超时固定为 5 秒(L318)。在低延迟
233233

234234
## Removal/Iteration Plan
235235

236-
### 可立即删除
236+
I found **11 issues** (P0: **1**, P1: **3**, P2: **5**, P3: **2**).
237+
238+
### 1. 可立即删除
237239
- `control/dns_control.go:635-637`: dead code(`if err != nil { return err }`),`err` 在此处一定为 nil。
238240

239-
### 后续迭代建议
241+
## 2. Action now
242+
0. MUST-FIX **Fix P0 + P1** — 修复并发竞争 + dead code + fallback 错误返回
243+
1. **Go race detector 验证**: 在 CI 中增加 `go test -race ./control/...` 以检测 P0-1 所述的数据竞争。
244+
245+
### 2. 后续迭代建议
240246
1. **DoUDP 并发安全修复** (P0-1): 优先修复 goroutine 与 `d.conn` 的竞争问题。
241247
2. **dialSend context 传播** (P1-3): 将 `context.TODO()` 替换为调用链 context。
242248
3. **forwarder 连接池化** (P2-1): 如果需要真正的连接复用,需重新设计 forwarder 生命周期。
243-
4. **测试补充** (P2-5): 补充连接生命周期和集成测试。
244-
245-
---
246-
247-
## Additional Suggestions
248-
249-
1. **Go race detector 验证**: 建议在 CI 中增加 `go test -race ./control/...` 以检测 P0-1 所述的数据竞争。
250-
2. **forwarder cache 指标**: 建议添加 cache hit/miss 计数器,以便观测 cache 效率。
251-
3. **UDP 重发流量放大**: 如 v3 计划所述,DoUDP 每次查询最多发送 5 个 UDP 包(每秒重发,共 5 秒)。压测下这会放大上游流量 5 倍。可考虑减少重试次数或缩短超时。
252-
253-
---
254-
255-
## Next Steps
256-
257-
I found **11 issues** (P0: **1**, P1: **3**, P2: **5**, P3: **2**).
258-
259-
MUST-FIX **Fix P0 + P1** — 修复并发竞争 + dead code + fallback 错误返回
249+
4. **测试补充** (P2-5): 补充连接生命周期和集成测试。

0 commit comments

Comments
 (0)