CAICAIIs opened a new pull request, #3192:
URL: https://github.com/apache/dubbo-go/pull/3192
问题:
1. 固定 ±50 容差对低权重目标(如 3.3% ≈ 33次期望)太严格,统计波动易超限
2. 使用 len(result) 作为 map key,不同 destination 产生相同长度时会覆盖权重
3. 样本量 1000 次不足以保证统计稳定性
修改:
| 修改项 | 原值 | 新值 |
|--------|------|------|
| 样本量 | 1000 | 5000 |
| Map key 类型 | any | int (明确类型) |
| 权重累加 | = (覆盖) | += (累加) |
| 容差算法 | 固定 ±50 | max(25% × expected, 50) |
| 断言 | assert.Fail("out of range") | assert.Truef() 带详细错误信息 |
### Description
Fixes #3176
### Checklist
- [x] I confirm the target branch is `develop`
- [x] Code has passed local testing
- [x] I have added tests that prove my fix is effective or that my feature
works
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]