From dev-return-86440-archive-asf-public=cust-asf.ponee.io@qpid.apache.org Fri Mar 16 21:57:06 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 9370A180608 for ; Fri, 16 Mar 2018 21:57:05 +0100 (CET) Received: (qmail 99553 invoked by uid 500); 16 Mar 2018 20:57:04 -0000 Mailing-List: contact dev-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list dev@qpid.apache.org Received: (qmail 99542 invoked by uid 99); 16 Mar 2018 20:57:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Mar 2018 20:57:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 0F66A180721 for ; Fri, 16 Mar 2018 20:57:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id G-fT81gs2d7S for ; Fri, 16 Mar 2018 20:57:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id E93E85F568 for ; Fri, 16 Mar 2018 20:57:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id EA5FFE032A for ; Fri, 16 Mar 2018 20:57:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5F95921289 for ; Fri, 16 Mar 2018 20:57:00 +0000 (UTC) Date: Fri, 16 Mar 2018 20:57:00 +0000 (UTC) From: "Alan Conway (JIRA)" To: dev@qpid.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (PROTON-1791) TCP sockets remain open in CLOSE_WAIT state MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PROTON-1791?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alan Conway resolved PROTON-1791. --------------------------------- Resolution: Fixed Tested against the reproducer program provided by [~miha-plesko] as well as additional self-tests added as part of the fix. > TCP sockets remain open in CLOSE_WAIT state > ------------------------------------------- > > Key: PROTON-1791 > URL: https://issues.apache.org/jira/browse/PROTON-1791 > Project: Qpid Proton > Issue Type: Bug > Components: ruby-binding > Affects Versions: proton-c-0.21.0 > Environment: Confirmed on Ubuntu 16.04 and RHEL 7.4 > Confirmed on qpid_proton 0.19.0 and 0.21.0 > Reporter: Miha Plesko > Assignee: Alan Conway > Priority: Major > Labels: bug > Fix For: proton-c-0.22.0 > > Attachments: idle-disconnect.png, stderr.txt, stdout.txt > > > Hi guys, > thanks for developing the awesome qpid_proton ruby gem, we're using it on daily basis! > However, recently we noticed following error in our server log: > Too many open files - socket(2) for "172.16.117.189" port 5672 > After some research it turns out that qpid_proton process is having increasingly > more and more following file descriptors open: > $ lsof -ap 108533 > ruby 108533 miha 116u IPv4 562438 0t0 TCP 172.16.117.189:53626->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 197u IPv4 561644 0t0 TCP 172.16.117.189:53630->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 311u IPv4 560657 0t0 TCP 172.16.117.189:53634->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 549u IPv4 565342 0t0 TCP 172.16.117.189:53642->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 576u IPv4 565122 0t0 TCP 172.16.117.189:53650->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 603u IPv4 565738 0t0 TCP 172.16.117.189:53654->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 630u IPv4 563021 0t0 TCP 172.16.117.189:53658->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 657u IPv4 568361 0t0 TCP 172.16.117.189:53662->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 666u IPv4 563027 0t0 TCP 172.16.117.189:53666->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 675u IPv4 567538 0t0 TCP 172.16.117.189:53670->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 684u IPv4 567998 0t0 TCP 172.16.117.189:53678->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 690u IPv4 574709 0t0 TCP 172.16.117.189:53686->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 693u IPv4 578725 0t0 TCP 172.16.117.189:53694->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 696u IPv4 576840 0t0 TCP 172.16.117.189:53698->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 699u IPv4 577819 0t0 TCP 172.16.117.189:53702->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 702u IPv4 582192 0t0 TCP 172.16.117.189:53710->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 705u IPv4 582861 0t0 TCP 172.16.117.189:53714->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 708u IPv4 577363 0t0 TCP 172.16.117.189:53718->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 711u IPv4 578175 0t0 TCP 172.16.117.189:53722->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 714u IPv4 587172 0t0 TCP 172.16.117.189:53730->147.75.102.132:amqp (CLOSE_WAIT) > ruby 108533 miha 717u IPv4 584387 0t0 TCP 172.16.117.189:53734->147.75.102.132:amqp (CLOSE_WAIT) > ... > I think the CLOSE_WAIT status of file descriptor indicates that the TCP > connection has already been closed, but the file descriptor wasn't closed. > After 9 hours or so there are enough of such file descriptors for OS to > complain about it. > We did all we could to close connections gracefully: > connection.container.stop > connection.close > connection = nil > but nothing seems to help. A simple but expensive workaround is to manually invoke Ruby's garbage collection, > but ideally `connection.close` would close the file descriptor. > May I kindly ask you to look at this? > Thank you and Best Regards, > Miha > PS: The error occurs both on Ubuntu 16.04 and RHEL 7.4 > PS2: The error occurs both on qpid_proton 0.19.0 and 0.21.0 -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org For additional commands, e-mail: dev-help@qpid.apache.org