mirror of https://github.com/apache/lucene.git
SOLR-4189: Fix hanging threads on FreeBSD in JettySolrRunner by making connector configureable through sysprop, listen only on 127.0.0.1 in tests
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1422127 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
17569aa775
commit
6af24c8866
|
@ -154,6 +154,7 @@
|
|||
<subant buildpath="." antfile="extra-targets.xml" target="-run-maven-build" inheritall="false" failonerror="true">
|
||||
<propertyset>
|
||||
<propertyref prefix="maven-"/>
|
||||
<propertyref builtin="commandline"/>
|
||||
</propertyset>
|
||||
</subant>
|
||||
</target>
|
||||
|
|
|
@ -99,6 +99,15 @@
|
|||
<doctitle>${project.name} ${project.version} API (${now.version})</doctitle>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<tests.jettyConnector>${tests.jettyConnector}</tests.jettyConnector>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
|
|
@ -56,6 +56,9 @@
|
|||
mavenVersion="${maven-version}" failonerror="true" fork="true">
|
||||
<arg value="-fae"/>
|
||||
<arg value="install"/>
|
||||
<syspropertyset>
|
||||
<propertyref builtin="commandline"/>
|
||||
</syspropertyset>
|
||||
</mvn>
|
||||
</target>
|
||||
|
||||
|
|
|
@ -916,6 +916,7 @@
|
|||
<propertyref prefix="tests.failfast" />
|
||||
<propertyref prefix="tests.badapples" />
|
||||
<propertyref prefix="tests.timeoutSuite" />
|
||||
<propertyref prefix="tests.jettyConnector" />
|
||||
</syspropertyset>
|
||||
|
||||
<!-- Pass randomized settings to the forked JVM. -->
|
||||
|
|
|
@ -154,12 +154,25 @@ public class JettySolrRunner {
|
|||
}
|
||||
System.setProperty("solr.solr.home", solrHome);
|
||||
if (System.getProperty("jetty.testMode") != null) {
|
||||
SelectChannelConnector connector = new SelectChannelConnector();
|
||||
final String connectorName = System.getProperty("tests.jettyConnector", "SelectChannel");
|
||||
final Connector connector;
|
||||
final QueuedThreadPool threadPool;
|
||||
if ("SelectChannel".equals(connectorName)) {
|
||||
final SelectChannelConnector c = new SelectChannelConnector();
|
||||
c.setReuseAddress(true);
|
||||
c.setLowResourcesMaxIdleTime(1500);
|
||||
connector = c;
|
||||
threadPool = (QueuedThreadPool) c.getThreadPool();
|
||||
} else if ("Socket".equals(connectorName)) {
|
||||
final SocketConnector c = new SocketConnector();
|
||||
c.setReuseAddress(true);
|
||||
connector = c;
|
||||
threadPool = (QueuedThreadPool) c.getThreadPool();
|
||||
} else {
|
||||
throw new IllegalArgumentException("Illegal value for system property 'tests.jettyConnector': " + connectorName);
|
||||
}
|
||||
connector.setPort(port);
|
||||
connector.setReuseAddress(true);
|
||||
connector.setLowResourcesMaxIdleTime(1500);
|
||||
QueuedThreadPool threadPool = (QueuedThreadPool) connector
|
||||
.getThreadPool();
|
||||
connector.setHost("127.0.0.1");
|
||||
if (threadPool != null) {
|
||||
threadPool.setMaxThreads(10000);
|
||||
threadPool.setMaxIdleTimeMs(5000);
|
||||
|
|
Loading…
Reference in New Issue