couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Goodall (JIRA)" <>
Subject [jira] Commented: (COUCHDB-580) Continuous feed closes connection after certain time
Date Thu, 26 Nov 2009 13:31:39 GMT


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

> Continuous feed closes connection after certain time
> ----------------------------------------------------
>                 Key: COUCHDB-580
>                 URL:
>             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 (,
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:
or use curl.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message