You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/05/28 09:19:16 UTC

[dubbo] branch master updated: Fix the calculation error of TimeoutCountDown#elapsedMillis method (#7880)

This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new 466db4f  Fix the calculation error of TimeoutCountDown#elapsedMillis method (#7880)
466db4f is described below

commit 466db4f7570804bb2db3f05d17b1cd0058756e98
Author: 灼华 <43...@users.noreply.github.com>
AuthorDate: Fri May 28 17:19:06 2021 +0800

    Fix the calculation error of TimeoutCountDown#elapsedMillis method (#7880)
---
 .../src/main/java/org/apache/dubbo/rpc/TimeoutCountDown.java            | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/TimeoutCountDown.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/TimeoutCountDown.java
index 91b561d..e5d1f00 100644
--- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/TimeoutCountDown.java
+++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/TimeoutCountDown.java
@@ -60,7 +60,7 @@ public final class TimeoutCountDown implements Comparable<TimeoutCountDown> {
     if (isExpired()) {
       return timeoutInMillis + TimeUnit.MILLISECONDS.convert(System.nanoTime() - deadlineInNanos, TimeUnit.NANOSECONDS);
     } else {
-      return TimeUnit.MILLISECONDS.convert(deadlineInNanos - System.nanoTime(), TimeUnit.NANOSECONDS);
+      return timeoutInMillis - TimeUnit.MILLISECONDS.convert(deadlineInNanos - System.nanoTime(), TimeUnit.NANOSECONDS);
     }
   }