mirror of https://github.com/apache/lucene.git
SOLR-1517: only do reverse DNS lookup of localhost once in a static block
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@826965 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b1e21e7041
commit
9b1b5e9206
|
@ -632,6 +632,11 @@ Bug Fixes
|
|||
often calculated offsets incorrectly for entities.
|
||||
(Anders Melchiorsen via yonik)
|
||||
|
||||
74. SOLR-1517: Admin pages could stall waiting for localhost name resolution
|
||||
if reverse DNS wasn't configured; this was changed so the DNS resolution
|
||||
is attempted only once the first time an admin page is loaded.
|
||||
(hossman)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
1. Upgraded to Lucene 2.4.0 (yonik)
|
||||
|
|
|
@ -25,6 +25,22 @@
|
|||
<%@ page import="org.apache.solr.common.SolrException"%>
|
||||
<%@ page import="org.apache.lucene.LucenePackage"%>
|
||||
<%@ page import="java.net.UnknownHostException" %>
|
||||
|
||||
<%!
|
||||
// only try to figure out the hostname once in a static block so
|
||||
// we don't have a potentially slow DNS lookup on every admin request
|
||||
static InetAddress addr = null;
|
||||
static String hostname = "unknown";
|
||||
static {
|
||||
try {
|
||||
addr = InetAddress.getLocalHost();
|
||||
hostname = addr.getCanonicalHostName();
|
||||
} catch (UnknownHostException e) {
|
||||
//default to unknown
|
||||
}
|
||||
}
|
||||
%>
|
||||
|
||||
<%
|
||||
//
|
||||
SolrCore core = (SolrCore) request.getAttribute("org.apache.solr.SolrCore");
|
||||
|
@ -48,14 +64,6 @@
|
|||
}
|
||||
|
||||
String collectionName = schema!=null ? schema.getName():"unknown";
|
||||
InetAddress addr = null;
|
||||
String hostname = "unknown";
|
||||
try {
|
||||
addr = InetAddress.getLocalHost();
|
||||
hostname = addr.getCanonicalHostName();
|
||||
} catch (UnknownHostException e) {
|
||||
//default to unknown
|
||||
}
|
||||
|
||||
String defaultSearch = "";
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue