You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Joscha Feth (JIRA)" <ji...@apache.org> on 2009/11/26 12:49:39 UTC

[jira] Created: (COUCHDB-580) Continuous feed closes connection after certain time

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.


[jira] Commented: (COUCHDB-580) Continuous feed closes connection after certain time

Posted by "Matt Goodall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782885#action_12782885 ] 

Matt Goodall commented on COUCHDB-580:
--------------------------------------

There's a default timeout of 60s. See http://wiki.apache.org/couchdb/HTTP_database_API#Changes.

> 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.


[jira] Closed: (COUCHDB-580) Continuous feed closes connection after certain time

Posted by "Joscha Feth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joscha Feth closed COUCHDB-580.
-------------------------------


> 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.


[jira] Commented: (COUCHDB-580) Continuous feed closes connection after certain time

Posted by "Joscha Feth (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782894#action_12782894 ] 

Joscha Feth commented on COUCHDB-580:
-------------------------------------

Agreed. I will close this issue then. Thanks for the clarification!

> 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.


[jira] Commented: (COUCHDB-580) Continuous feed closes connection after certain time

Posted by "Matt Goodall (JIRA)" <ji...@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.


[jira] Commented: (COUCHDB-580) Continuous feed closes connection after certain time

Posted by "Joscha Feth (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782886#action_12782886 ] 

Joscha Feth commented on COUCHDB-580:
-------------------------------------

Hi Matt,

I see  - Thanks for your hint - sorry I missed that - I added a comment to the book chapter, hopefully it will also be reflected there, soon.
So as I can see from the options available, I can either set the timeout incredibly high (setting it to zero does not seem possible, I'd have expected if I give a zero timeout it will stay open forever?!) or I can use the heartbeat, which has the overhead of sending data (even though it is only a newline) over the wire every X ms.

Is it planned to support &timeout=0 in future?

> 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.


[jira] Resolved: (COUCHDB-580) Continuous feed closes connection after certain time

Posted by "Joscha Feth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joscha Feth resolved COUCHDB-580.
---------------------------------

    Resolution: Invalid

> 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.