Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0AE83C3FD for ; Sat, 26 Jan 2013 12:39:21 +0000 (UTC) Received: (qmail 69300 invoked by uid 500); 26 Jan 2013 12:39:20 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 69275 invoked by uid 500); 26 Jan 2013 12:39:20 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 69233 invoked by uid 99); 26 Jan 2013 12:39:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Jan 2013 12:39:19 +0000 Date: Sat, 26 Jan 2013 12:39:18 +0000 (UTC) From: "Dave Cottlehuber (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (COUCHDB-1520) Replicator does not close Socket in pull from HTTPS source 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/COUCHDB-1520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13563473#comment-13563473 ] Dave Cottlehuber commented on COUCHDB-1520: ------------------------------------------- Bob, what OTP version did you test this with? There are a number of R15B* fixes for various SSL fixes that superficially could be related. Simon, if you can reliably duplicate this you might want to try bumping erlang to R15B03-1 and seeing if this still happens. You should recompile CouchDB after erlang as well, to be on the safe side. Also that ubuntu is ooooold :-) > Replicator does not close Socket in pull from HTTPS source > ---------------------------------------------------------- > > Key: COUCHDB-1520 > URL: https://issues.apache.org/jira/browse/COUCHDB-1520 > Project: CouchDB > Issue Type: Bug > Components: Replication > Affects Versions: 1.2 > Environment: Ubuntu 8.04, Erlang 14.b.4 64bit > Reporter: Simon Eisenmann > Assignee: Robert Newson > Priority: Critical > Labels: close, https, leak, replication, socket, ssl > Fix For: 1.3 > > > When replicating using pull replication from an HTTPS-CouchDB source, the client socket does not go away, but stays in CLOSE_WAIT forever, This will crash the whole CouchDB server, as it will run out of file descriptors. > This did not happen with CouchDB 1.1. > I experimented with changing the socket options for the replicator client, though no luck. The only change i saw was then running with keepalive (which was the default), also the server side (pull peer) leaks a connection. Now i am running with socket_options = [{keepalive, false}, {send_timeout, 10000}, {send_timeout_close, true}] > which does not change a thing other than on the client side is leaking connections. > To test this, you need the PID of the couchdb's beam process (ps aux |grep beam) > Then you list all the open files of this PID with "lsof -p $PID" > First you will see the pull connections beeing in ESTABLISHED state for a wile (even when the replication itself is long finished), Then at some point it switches to CLOSE_WAIT. The client side socket needs to be closed by the replicator to go away and release the resources (eg. file pointer). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira