From dev-return-7493-apmail-couchdb-dev-archive=couchdb.apache.org@couchdb.apache.org Thu Nov 26 13:32:12 2009 Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 88681 invoked from network); 26 Nov 2009 13:32:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Nov 2009 13:32:12 -0000 Received: (qmail 98200 invoked by uid 500); 26 Nov 2009 13:32:11 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 98115 invoked by uid 500); 26 Nov 2009 13:32:11 -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 98105 invoked by uid 99); 26 Nov 2009 13:32:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2009 13:32:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Nov 2009 13:32:00 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8F88A234C04C for ; Thu, 26 Nov 2009 05:31:39 -0800 (PST) Message-ID: <2027587838.1259242299572.JavaMail.jira@brutus> Date: Thu, 26 Nov 2009 13:31:39 +0000 (UTC) From: "Matt Goodall (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-580) Continuous feed closes connection after certain time In-Reply-To: <263063641.1259236179585.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782892#action_12782892 ] Matt Goodall commented on COUCHDB-580: -------------------------------------- Sorry, cannot comment on future plans but I doubt a timeout=0 will be supported as it could cause CouchDB to accumulate an endless list of dead connections. Basically, both ends of the connection need to know if the socket is closed for whatever reason- CouchDB needs to clean up so it's not wasting time; clients need to reconnect. The TCP stack alone is typically not good enough so most protocols resort to sending some sort of ping packet. By default CouchDB will simply close the connection after a period of time (the default 60s) presumably to ensure (potentially) dead sockets are removed from its _changes list. A live but quiet client can simply reopen the connection, no big deal. As soon as the client specifies a heartbeat then the client is saying, "I'm expecting a newline every x seconds and will close or recycle the connection if I don't see it". In addition, CouchDB should eventually see a failure trying to send the heartbeat newline and can use that to clean up dead connections. Failure detection at both ends ... perfect. If you set the timeout "incredibly high" all you're doing is delaying when the client and CouchDB can detect a dead socket, and therefore delaying when you decide to recover from that condition. > Continuous feed closes connection after certain time > ---------------------------------------------------- > > Key: COUCHDB-580 > URL: https://issues.apache.org/jira/browse/COUCHDB-580 > Project: CouchDB > Issue Type: Bug > Components: HTTP Interface > Affects Versions: 0.10 > Environment: Mac OSX > Reporter: Joscha Feth > > When listening for changes using the continuous feed, e.g.: > spreadsheets/_changes?feed=continuous > it seems as if contrary to what is described here (http://books.couchdb.org/relax/reference/change-notifications), the connections gets closed after a certain time by couchdb and a > {"last_seq":XYZ} > gets sent. > For sample code, please have a look here: http://stackoverflow.com/questions/1640653/how-do-you-use-couchdb-change-notifications-continuous-changes-from-java/ or use curl. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.