shawnh2 commented on code in PR #554:
URL: https://github.com/apache/dubbo-go-pixiu/pull/554#discussion_r1161704158
##########
pixiu/pkg/cluster/loadbalancer/rand/load_balancer_rand.go:
##########
@@ -33,5 +33,5 @@ func init() {
type Rand struct{}
func (Rand) Handler(c *model.ClusterConfig, _ model.LbPolicy) *model.Endpoint {
- return c.GetEndpoint(true)[rand.Intn(len(c.Endpoints)-1)]
+ return c.GetEndpoint(true)[rand.Intn(len(c.Endpoints))]
Review Comment:
请问一下大佬这个操作会引发什么panic?因为根据目前的压测和随机范围来看,如果有5个节点,是只会随机到前四个上面的,最后一个接收不到任何请求。
--
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]