Solr query continues after client disconnects?

2019-05-07 05:00发布

问题:

I have a theory about a problem I'm having with long-running queries against Solr, but I don't know if it is true, nor do I know how to test it.

I am querying Solr from an application with cURL. cURL has been configured in such a way that if Solr hasn't sent a response within 3 seconds, it gives up and disconnects, allowing the application hosting cURL to continue without the requested data from Solr. The theory is that after cURL disconnects, Solr still continues processing the query in the background.

Is this what Solr does? If so, is there a configuration option to change this behavior? Is there any real way to test this behavior?

回答1:

Solr does not timeout queries. One simple test is to hit the server again after a few seconds with the same query that had not completed within 3s. If query cache etc. is properly configured, then you should get an (almost) immediate response. This sort of shows that the query execution was not interrupted when the client disconnected. (This test is not very reliable, there can be many other factors which can lead to a query executing faster the second time)

Also, see this

You can experiment with the timeAllowed parameter described here to see if it will help.



标签: solr