xiaoma2015 opened a new pull request, #2289: URL: https://github.com/apache/brpc/pull/2289
### What problem does this PR solve? Issue Number: Problem Summary: 如果每次都是在新线程去使用rr的client,tls.offset会清空,然后重新选一个质数去取模机器数,极端情况下会出现有些机器永远都选不中的情况,server端的qps会出现明显倾斜的情况  **** ### What is changed and the side effects? Changed: tls.offset = butil::fast_rand_less_than(n); 在第一次使用offset时使用随机数而不是取值为0,这样可以避免第一次使用的质数的个位数只能是(1,3,7,9)这些数字的问题 Side effects: - Performance effects(性能影响): 很小 - Breaking backward compatibility(向后兼容性): 无 --- ### Check List: - Please make sure your changes are compilable(请确保你的更改可以通过编译). - When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试). - Please follow [Contributor Covenant Code of Conduct](../../master/CODE_OF_CONDUCT.md).(请遵循贡献者准则). -- 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]
