pool icon indicating copy to clipboard operation
pool copied to clipboard

代码存在一个问题index 请求的标记

Open gcggcg opened this issue 2 years ago • 1 comments

从代码可以看出index在每次get获取连接的时候会自动加1,而且是uint32类型, 但是没有在请求后进行原子性的-1操作,会造成隐患,那就是index的值一直增加最终将会导致超出范围异常的局面。 还请你检查一下,是不是可以在conn.close的时候进行即使的-1操作会更加合理。

gcggcg avatar Mar 02 '22 09:03 gcggcg

溢出也没问题,目前是使用 Round-Robin 的方式 选择 conn,实现上 index 会一直在 0~MaxUint32 之间 循环。。。

shimingyah avatar May 17 '22 13:05 shimingyah