the diff is
```diff
index ed6f3c4e9..14640d4fb 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/AbstractLoadBalance.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/AbstractLoadBalance.java
@@ -24,6 +24,7 @@ import org.apache.dubbo.rpc.cluster.LoadBalance;
import java.util.List;
+import static
org.apache.dubbo.common.constants.CommonConstants.TIMESTAMP_KEY;^M
import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_WARMUP;
import static org.apache.dubbo.rpc.cluster.Constants.DEFAULT_WEIGHT;
import static org.apache.dubbo.rpc.cluster.Constants.REMOTE_TIMESTAMP_KEY;
@@ -73,11 +74,11 @@ public abstract class AbstractLoadBalance implements
LoadBalance {
protected int getWeight(Invoker<?> invoker, Invocation invocation) {
int weight =
invoker.getUrl().getMethodParameter(invocation.getMethodName(), WEIGHT_KEY,
DEFAULT_WEIGHT);
if (weight > 0) {
- long timestamp =
invoker.getUrl().getParameter(REMOTE_TIMESTAMP_KEY, 0L);
+ long timestamp = invoker.getUrl().getParameter(TIMESTAMP_KEY,
0L);^M
if (timestamp > 0L) {
- int uptime = (int) (System.currentTimeMillis() - timestamp);
+ int uptime = (int) Math.max(System.currentTimeMillis() -
timestamp, 0);^M
int warmup = invoker.getUrl().getParameter(WARMUP_KEY,
DEFAULT_WARMUP);
- if (uptime > 0 && uptime < warmup) {
+ if (uptime >= 0 && uptime < warmup) {^M
weight = calculateWarmupWeight(uptime, warmup, weight);
}
}
```
[ Full content available at: https://github.com/apache/dubbo/pull/4870 ]
This message was relayed via gitbox.apache.org for
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]