couchdb-lucene
couchdb-lucene copied to clipboard
Timeouts when request made shortly after design document changes
Hi,
As discussed on IRC I am getting timeouts from _fti due to an ajax request hanging.
Creating a new couchapp and removing "evently/items/_changes/query.json" and putting in a "evently/items/_changes/async.js" that contains:
function (callback) {
console.log("Something changed!");
var app = $$(this).app;
$.ajax({type: "GET", url: app.db.uri + "_fti/_design/test/by_content?q=baa", dataType: "json",
success: function(data, textStatus, req) {
console.log("%o", data);
}
});
}
should demonstrate the issue.
If you do this then push to your couchdb, open the page as it says, and then push again, now if you try and hit an _fti URL it will hang until you get an os process timeout.
If you change the code to move the $.ajax call in to a timeout for 1s or more later, then everything works as it should.
I can reproduce this on 0.10.0 and 1.0.1, and with tips of 0.5.x and master.
Let me know if I can provide you with any more inforamtion.
Thanks,
James
Thanks for the details. I tried this and cannot reproduce the issue, hopefully you'll be on IRC later.
In the meantime, if you can induce the condition again I'd appreciate a thread dump from Java. You can induce this will 'kill -QUIT <pid>'. The output should go to the screen where you are running bin/run from, please paste the whole output to a paste service somewhere, it should highlight exactly where the Java code is locked.
I'm also noticing the timeouts. Even with stale=ok
I have a couchdb database 25M docs with a couchdb-lucene index and I'm in the process of massively updating that database.
I noticed that all _fti queries are giving 500 internal errors. Tried to restart couchdb-lucene and that didn't help. I paused my script that was updating the the database, waited till c-l catchup with the backlog and it started working again.