Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3AD1B200CE7 for ; Fri, 18 Aug 2017 08:04:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3930416C4F1; Fri, 18 Aug 2017 06:04:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A4A7316C4EF for ; Fri, 18 Aug 2017 08:04:11 +0200 (CEST) Received: (qmail 33117 invoked by uid 500); 18 Aug 2017 06:04:10 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 33106 invoked by uid 99); 18 Aug 2017 06:04:10 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Aug 2017 06:04:10 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 03C76E0610; Fri, 18 Aug 2017 06:04:10 +0000 (UTC) From: bitgaoshu To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org References: In-Reply-To: Subject: [GitHub] zookeeper pull request #336: ZOOKEEPER-2836: fix SocketTimeoutException Content-Type: text/plain Message-Id: <20170818060410.03C76E0610@git1-us-west.apache.org> Date: Fri, 18 Aug 2017 06:04:10 +0000 (UTC) archived-at: Fri, 18 Aug 2017 06:04:12 -0000 Github user bitgaoshu commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/336#discussion_r133885327 --- Diff: src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java --- @@ -647,11 +648,10 @@ public void run() { numRetries = 0; } } catch (IOException e) { - if (shutdown) { - break; - } LOG.error("Exception while listening", e); - numRetries++; + if (!(e instanceof SocketTimeoutException)) { --- End diff -- - update - l checked the native method `java.net.PlainSocketImpl.socketAccept(Native Method)` in [openjdk](http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/9d617cfd6717/src/solaris/native/java/net/PlainSocketImpl.c), **line709-721**, in which it changed from 0 to -1. and then timeout of -1 is interpreted as an infinite timeout. In some cases, [-1 was interpreted as a larger positive integer](https://lwn.net/Articles/483078/). so this issue always happend after 49days. It's my wild conjecture. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---