Re: HttpSolrClient Connection Evictor

2020-08-09 Thread Shawn Heisey

On 8/9/2020 2:46 AM, Srinivas Kashyap wrote:

We are using HttpSolrClient(solr-solrj-8.4.1.jar) in our app along with 
required jar(httpClient-4.5.6.jar). Before that we upgraded these jars from 
(solr-solrj-5.2.1.jar) and (httpClient-4.4.1.jar).

After we upgraded, we are seeing lot of below connection evictor statements in 
log file.

DEBUG USER_ID - STEP 2020-08-09 13:59:33,085 [Connection evictor] - Closing 
expired connections
DEBUG USER_ID - STEP 2020-08-09 13:59:33,085 [Connection evictor] - Closing 
connections idle longer than 5 MILLISECONDS


These logs are coming from the HttpClient library, not from SolrJ. 
Those actions appear to be part of HttpClient's normal operation.


It is entirely possible that the older version of the HttpClient library 
doesn't create these debug-level log entries.  That library is managed 
by a separate project under the Apache umbrella -- we here at the Solr 
project are not involved with it.


The solution here is to change your logging level.  You can either 
change the level of the main logger to something like INFO or WARN, or 
you can reduce the logging level of the HttpClient classes without 
touching the rest.  I do not know what logging system you are using.  If 
you need help with how to configure it, the people who made the logging 
system are much better equipped to configure it than we are.


I personally would change the default logging level for the whole 
program.  Those messages are logged at the DEBUG level.  Running an 
application with all loggers set that low should only be done when 
debugging a problem ... that level is usually far too verbose for a 
production system.  I do not recommend it at all.


If you choose to only change the level of the HttpClient classes, those 
loggers all start with "org.apache.http" which you will need for your 
logging configuration.


An additional note:  Your code should *not* create and close the 
HttpSolrClient for every query as you have done.  The HttpSolrClient 
object should be created once and re-used for the life of the program.


Thanks,
Shawn


HttpSolrClient Connection Evictor

2020-08-09 Thread Srinivas Kashyap
Hello,

We are using HttpSolrClient(solr-solrj-8.4.1.jar) in our app along with 
required jar(httpClient-4.5.6.jar). Before that we upgraded these jars from 
(solr-solrj-5.2.1.jar) and (httpClient-4.4.1.jar).

After we upgraded, we are seeing lot of below connection evictor statements in 
log file.

DEBUG USER_ID - STEP 2020-08-09 13:59:33,085 [Connection evictor] - Closing 
expired connections
DEBUG USER_ID - STEP 2020-08-09 13:59:33,085 [Connection evictor] - Closing 
connections idle longer than 5 MILLISECONDS
DEBUG USER_ID - STEP 2020-08-09 13:59:33,154 [Connection evictor] - Closing 
expired connections
DEBUG USER_ID - STEP 2020-08-09 13:59:33,154 [Connection evictor] - Closing 
connections idle longer than 5 MILLISECONDS
DEBUG USER_ID - STEP 2020-08-09 13:59:33,168 [Connection evictor] - Closing 
expired connections
DEBUG USER_ID - STEP 2020-08-09 13:59:33,168 [Connection evictor] - Closing 
connections idle longer than 5 MILLISECONDS
DEBUG USER_ID - STEP 2020-08-09 13:59:33,172 [Connection evictor] - Closing 
expired connections
DEBUG USER_ID - STEP 2020-08-09 13:59:33,172 [Connection evictor] - Closing 
connections idle longer than 5 MILLISECONDS
DEBUG USER_ID - STEP 2020-08-09 13:59:33,214 [Connection evictor] - Closing 
expired connections
DEBUG USER_ID - STEP 2020-08-09 13:59:33,214 [Connection evictor] - Closing 
connections idle longer than 5 MILLISECONDS
DEBUG USER_ID - STEP 2020-08-09 13:59:34,061 [Connection evictor] - Closing 
expired connections
DEBUG USER_ID - STEP 2020-08-09 13:59:34,061 [Connection evictor] - Closing 
connections idle longer than 5 MILLISECONDS

These statements appear when we try to access a module which is bound with solr 
as shown below:

HttpSolrClient client = null;
try
{
  client =  new HttpSolrClient.Builder(solrURL).build();

  QueryResponse response = client.query(query);

}
finally
{
  if(client!=null)
  {
try {
  client.close();
} catch (IOException e) {
  logger.debug("Error in closing 
HttpSolrClient"+e.getMessage());
}
  }
}

Is there a way we can turn off the logging or set something which doesn't cause 
log statements to appear?

Thanks,
Srinivas

DISCLAIMER:
E-mails and attachments from Bamboo Rose, LLC are confidential.
If you are not the intended recipient, please notify the sender immediately by 
replying to the e-mail, and then delete it without making copies or using it in 
any way.
No representation is made that this email or any attachments are free of 
viruses. Virus scanning is recommended and is the responsibility of the 
recipient.

Disclaimer

The information contained in this communication from the sender is 
confidential. It is intended solely for use by the recipient and others 
authorized to receive it. If you are not the recipient, you are hereby notified 
that any disclosure, copying, distribution or taking action in relation of the 
contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been 
automatically archived by Mimecast Ltd, an innovator in Software as a Service 
(SaaS) for business. Providing a safer and more useful place for your human 
generated data. Specializing in; Security, archiving and compliance. To find 
out more visit the Mimecast website.