-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP+filtered changes fails with ESOCKETTIMEDOUT on large CouchDB changeset #3550
Comments
I assume this is Node.js? Can you provide a public version of your database so that we can reproduce? This seems like some Node-specific error handler that we're not setting. @calvinmetcalf any suggestions? |
I feel tempted to just do one of those process.on('ESOCKETTIMEDOUT', function () {
// do something
}); But that can't possibly be the "Node way" of handling this kind of error. |
it's a timeout error you just handle it like a regular error... |
So are we supposed to handle this? Or is it the user's responsibility to handle it in an |
I guess I wasn't explicit enough about the issue. This isn't about how the error is reported, it's about "there shouldn't be a timeout at that point since CouchDB accepted the connection and it's just taking some time to generate the data". I'll do a quick grep in the code to see if I can figure where that 31 seconds timer comes from. |
Here are some steps to recreate:
The expected outcome is that no changes are reported and the query returns normally.
The first line is sent immediately, the last two lines are sent at the end of the filter, for example after 48s in my last run. |
|
If I provide an |
OK, found it. PouchDB's |
@nolanlawson Yes this applies to Node.js and the HTTP adapter, although I suspect similar problems will occur in the browser. |
Thanks for all the detailed research. So it seems we should either document this, or make sure that the timeout from |
Oh wait, you're already on it. Nice! :) |
I had the same error replicating a large pouchdb database (40K docs) to an online couchdb instance. It was replicating just fine, but I got |
I believe the timeout is a Node-wide setting, but I'm not sure TBH. |
Hi, I have the same error with the last Version.
Here is my config : var options = {
continuous: true,
live: true,
since: 0,
include_docs: true,
batch_size : 1000,
filter : 'globalFilter/demandesToBackend'
};
db.changes(options)
.on('change', function (change) {
logger.info('demande occured ', change);
})
.on('error', function(e){
logger.error("error in globalRemoteDB.changes : ",e);
}); |
this definitely threw me for a loop, too. I did not expect the changes timeout to be different than the primary |
If CouchDB contains a large changeset (in my case, 170K+ deletions), filtered replication will take some time to process in CouchDB (which is OK), but PouchDB's
.changes
will fail with anESOCKETTIMEDOUT
error:This is repeatable; the error shows up 31 seconds after the start of the request.
(This is PouchDB 3.3.1 against CouchDB 1.4.0.
since
in the query is at 1897043, while theupdate_seq
of the database is 2020286. CouchDB logs show it running the filter.)Doing a plain
curl
at the command prompt with the same parameters as the PouchDB request,curl
just waits for the data to come in:I tried playing with
ajax.timeout
since this is the only timer available, but unsurprisingly it doesn't affect the outcome, since the TCP connection is established (there's no timeout at the network level).Note: this might be related to the second problem described in #3210
The text was updated successfully, but these errors were encountered: