Hi guys.
I'm running a little upload project that uploads documents into a solr
index. there is also a 2nd thread that runs a deleteby query and a
optimize every once and a while.
in an effort to reduce the probably of things being held onto I've made
everything local, but it is still collecting CLOSE_WAITs and FIN_WAIT2's
on the server side until it eventually runs out of file handles in a day
or two.
the following are the code snippets being used to call solr.
protected void doArchiveSolr() throws IOException, SolrServerException {
Calendar rightNow = Calendar.getInstance();
rightNow.add(Calendar.DATE, 31 * -1);
DateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
java.util.Date d = rightNow.getTime();
String s = "publish_date:[1976-03-06T23:59:59.999Z/YEAR TO " +
f.format(d) + "]";
logger.info("Archiver:" + s);
CommonsHttpSolrServer solrServer;
solrServer = new CommonsHttpSolrServer(solrURL);
solrServer.deleteByQuery(s);
solrServer.commit();
}
and this runs every X minutes.
it also has other local parts like
{
CommonsHttpSolrServer solrServer;
solrServer = new CommonsHttpSolrServer(solrURL);
solrServer.optimize();
}
and
{
CommonsHttpSolrServer solrServer;
UpdateResponse r;
solrServer = new CommonsHttpSolrServer(solrUrl);
solrServer.setSoTimeout(120000); // socket read
timeout 2minutes
solrServer.setConnectionTimeout(100);
solrServer.setDefaultMaxConnectionsPerHost(100);
solrServer.setMaxTotalConnections(100);
solrServer.setFollowRedirects(false); //
defaults to false
solrServer.setAllowCompression(false);
r = solrServer.add(docs);
r = solrServer.commit();
docs.clear();
}