You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "LaughXP (GitHub)" <gi...@apache.org> on 2018/12/29 09:08:02 UTC
[GitHub] [incubator-dubbo] LaughXP opened issue #3097: 使用leastactive在provider启动时不会使用预热功能
使用leastactive, provider启动后, 由于sameWeight=true(默认都是100), 导致无法走到以下步骤
```java
if (!sameWeight && totalWeight > 0) {
// If (not every invoker has the same weight & at least one invoker's weight>0), select randomly based on totalWeight.
int offsetWeight = random.nextInt(totalWeight);
// Return a invoker based on the random value.
for (int i = 0; i < leastCount; i++) {
int leastIndex = leastIndexs[i];
offsetWeight -= getWeight(invokers.get(leastIndex), invocation);
if (offsetWeight <= 0)
return invokers.get(leastIndex);
}
}
```
就无法调用getWeight方法进行预热。这是一个bug吗?
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3097 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] LaughXP commented on issue #3097: 使用leastactive在provider启动时不会使用预热功能
Posted by "LaughXP (GitHub)" <gi...@apache.org>.
2.6.x解决了
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3097 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] LaughXP closed issue #3097: 使用leastactive在provider启动时不会使用预热功能
Posted by "LaughXP (GitHub)" <gi...@apache.org>.
[ issue closed by LaughXP ]
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3097 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] congcongfu commented on issue #3097: 使用leastactive在provider启动时不会使用预热功能
Posted by "congcongfu (GitHub)" <gi...@apache.org>.
我也遇到了
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3097 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] careyyu commented on issue #3097: 使用leastactive在provider启动时不会使用预热功能
Posted by "careyyu (GitHub)" <gi...@apache.org>.
围观围观
// assert(leastCount > 0)
if (leastCount == 1) {
// 如果只有一个最小则直接返回, 大流量场景下 一个provider启动,会不会直接进入到这里呢
return invokers.get(leastIndexs[0]);
}
if (! sameWeight && totalWeight > 0) {
int offsetWeight = random.nextInt(totalWeight);
for (int i = 0; i < leastCount; i++) {
int leastIndex = leastIndexs[i];
offsetWeight -= getWeight(invokers.get(leastIndex), invocation);
if (offsetWeight <= 0)
return invokers.get(leastIndex);
}
}
[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3097 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org