I am seeing exceptions from some code I have written using SolrJ.I have
placed it into a pastebin:
http://pastebin.com/XnB83Jay
I am creating a MultiThreadedHttpConnectionManager object, which I use
to create an HttpClient, and that is used by all my
CommonsHttpSolrServer objects, of which there are 56 total.That's two
index chains, seven shards per chain, two cores per shard (live and
build). This accounts for half of the objects - for each of those,
there is a matching machine-level server object for CoreAdmin. In most
circumstances only 14 of those are in active use, but when a full index
rebuild is needed, almost all of them are used. I have some plans that
will reduce the number of machine-level server objects from 28 to 4,
which is the actual number of machines I'm running.
Static._mgr = new MultiThreadedHttpConnectionManager();
_mgrParams = Static._mgr.getParams();
_mgrParams.setTcpNoDelay(true);
_mgrParams.setConnectionTimeout(30000);
_mgrParams.setStaleCheckingEnabled(true);
Static._mgr.setParams(_mgrParams);
_mgrParams = null;
Static._client = new HttpClient(Static._mgr);
Here's the code that creates the server objects. The setMaxRetries is a
recent change, the problem was happening before I added it, though it
does seem to happen less often now:
_solrServer = new CommonsHttpSolrServer(serverBaseUrl, Static._client);
_solrCore = new CommonsHttpSolrServer(coreBaseUrl, Static._client);
_solrServer.setMaxRetries(1);
_solrCore.setMaxRetries(1);
The exception linked above will typically show up within a second or two
of the start of an update cycle, well before the 30 second connection
timeout I've specified in the parameters.What it's doing when this
happens is part of a delete process, specifically it is executing a
query to count the number of matching items.If any are found, then it
will follow this with the actual deleteByQuery.
The Solr servers are running a slightly modified 3.5.0, with patches
from SOLR-2906 and SOLR-1972 applied.I am not actually using the LFU
cache implemented in SOLR-2906.The same problem happened when I was
using version 3.4.0 with only SOLR-1972 applied. The SolrJ jar comes
from the same build as the custom Solr I'm running.
It looks like something is resetting the TCP connection, but I can't
tell what, or where the problem is.Solr works fine as far as I can
tell.Can anyone help?Have I done something wrong in creating my
HttpClient or my server objects?
Thanks,
Shawn