From dev-return-118-archive-asf-public=cust-asf.ponee.io@dubbo.apache.org Tue Mar 13 02:31:45 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5625618064D for ; Tue, 13 Mar 2018 02:31:45 +0100 (CET) Received: (qmail 17694 invoked by uid 500); 13 Mar 2018 01:31:44 -0000 Mailing-List: contact dev-help@dubbo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@dubbo.apache.org Delivered-To: mailing list dev@dubbo.apache.org Received: (qmail 17683 invoked by uid 99); 13 Mar 2018 01:31:43 -0000 Received: from mail-relay.apache.org (HELO mailrelay1-lw-us.apache.org) (207.244.88.152) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Mar 2018 01:31:43 +0000 Received: from [30.5.96.121] (unknown [42.120.74.97]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id 61C6CB0F for ; Tue, 13 Mar 2018 01:31:41 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Subject: Re: Why heartbeatTimeout is 3 times as much as heartbeat? From: jun liu X-Priority: 3 In-Reply-To: Date: Tue, 13 Mar 2018 09:31:38 +0800 Content-Transfer-Encoding: quoted-printable Message-Id: <031CA258-3ED3-42C0-A4D8-ABC0D499F153@gmail.com> References: To: dev@dubbo.apache.org X-Mailer: Apple Mail (2.3445.4.7) > hi, I'm a little puzzled, why heartbeatTimeout is 3 times as much as = heartbeat? Heart determines the interval to detect, while heartbeatTimeout = determines when to announce the connection is broken.=20 3 times is the maximum heartbeat failures dubbo can bear before mark a = connection as broken. > On 10 Mar 2018, at 5:58 PM, =E5=A4=A9 <1197596604@qq.com> wrote: >=20 > hi, I'm a little puzzled, why heartbeatTimeout is 3 times as much as = heartbeat? >=20 >=20 > public HeaderExchangeServer(Server server) { > if (server =3D=3D null) { > throw new IllegalArgumentException("server =3D=3D null"); > } > this.server =3D server; > this.heartbeat =3D = server.getUrl().getParameter(Constants.HEARTBEAT_KEY, 0); > this.heartbeatTimeout =3D = server.getUrl().getParameter(Constants.HEARTBEAT_TIMEOUT_KEY, heartbeat = * 3); > if (heartbeatTimeout < heartbeat * 2) { > throw new IllegalStateException("heartbeatTimeout < = heartbeatInterval * 2"); > } > startHeatbeatTimer(); > }