From b3d80c97fd0a44cb38e2679840bd0b4c74965ce6 Mon Sep 17 00:00:00 2001 From: Zhong Chaoqiang <35595648+ZhongChaoqiang@users.noreply.github.com> Date: Tue, 28 Sep 2021 17:51:34 +0800 Subject: [PATCH] fix: incorrect expire time of client request (#164) --- .../com/xiaomi/infra/pegasus/rpc/async/ClientRequestRound.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/xiaomi/infra/pegasus/rpc/async/ClientRequestRound.java b/src/main/java/com/xiaomi/infra/pegasus/rpc/async/ClientRequestRound.java index 9f9d2d70..aa44317e 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/rpc/async/ClientRequestRound.java +++ b/src/main/java/com/xiaomi/infra/pegasus/rpc/async/ClientRequestRound.java @@ -22,6 +22,7 @@ import com.xiaomi.infra.pegasus.operator.client_operator; import com.xiaomi.infra.pegasus.rpc.Table; import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; import org.slf4j.Logger; /** Created by weijiesun on 16-11-25. */ @@ -56,7 +57,7 @@ public ClientRequestRound( this.enableCounter = enableCounter; this.createNanoTime = System.nanoTime(); - this.expireNanoTime = createNanoTime + timeoutInMilliseconds; + this.expireNanoTime = createNanoTime + TimeUnit.MILLISECONDS.toNanos(timeoutInMilliseconds); this.isCompleted = false; this.tryId = 1; this.backupRequestTask = null;