From 969cf67d34ab1e6766ed1c695bcebbf731d0bf72 Mon Sep 17 00:00:00 2001 From: neverchanje Date: Thu, 17 Jan 2019 12:12:32 +0800 Subject: [PATCH] add comment --- .../com/xiaomi/infra/pegasus/rpc/async/ReplicaSession.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/xiaomi/infra/pegasus/rpc/async/ReplicaSession.java b/src/main/java/com/xiaomi/infra/pegasus/rpc/async/ReplicaSession.java index 8c90bdf5..b9403ff8 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/rpc/async/ReplicaSession.java +++ b/src/main/java/com/xiaomi/infra/pegasus/rpc/async/ReplicaSession.java @@ -328,6 +328,10 @@ private final static class VolatileFields { private Bootstrap boot; private EventLoopGroup rpcGroup; + // Session will be actively closed if there're successive timeout errors across + // `sessionResetTimeWindowMs`, after which we suspect that the server is unavailable. + + // Timestamp of the first timed out rpc. private AtomicLong firstRecentTimedOutMs; private static final long sessionResetTimeWindowMs = 10 * 1000; // 10s