mirror of https://github.com/apache/lucene.git
Merge branch 'apache-https-master' into jira/solr-8593
This commit is contained in:
commit
a9bdfdec10
|
@ -140,6 +140,9 @@ Other Changes
|
|||
* SOLR-9972: SpellCheckComponent collations and suggestions returned as a JSON object rather than a list
|
||||
(Christine Poerschke in response to bug report from Ricky Oktavianus Lazuardy)
|
||||
|
||||
* SOLR-9983: Fixing NullPointerException failure by TestManagedSchemaThreadSafety
|
||||
adding check for Zookeeper session expiration (Steve Rowe, Mikhail Khludnev)
|
||||
|
||||
================== 6.4.1 ==================
|
||||
|
||||
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
|
||||
|
@ -156,6 +159,7 @@ Jetty 9.3.14.v20161028
|
|||
Bug Fixes
|
||||
----------------------
|
||||
* SOLR-9969: "Plugin/Stats" section of the UI doesn't display empty metric types (Tomás Fernández Löbbe)
|
||||
* SOLR-8491: solr.cmd SOLR_SSL_OPTS is overwritten (Sam Yi, Andy Hind, Marcel Berteler, Kevin Risden)
|
||||
|
||||
================== 6.4.0 ==================
|
||||
|
||||
|
|
|
@ -45,71 +45,71 @@ set "SOLR_SSL_OPTS= "
|
|||
IF DEFINED SOLR_SSL_KEY_STORE (
|
||||
set "SOLR_JETTY_CONFIG=--module=https"
|
||||
set SOLR_URL_SCHEME=https
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Dsolr.jetty.keystore=%SOLR_SSL_KEY_STORE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.keystore=%SOLR_SSL_KEY_STORE%"
|
||||
IF DEFINED SOLR_SSL_KEY_STORE_PASSWORD (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Dsolr.jetty.keystore.password=%SOLR_SSL_KEY_STORE_PASSWORD%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.keystore.password=%SOLR_SSL_KEY_STORE_PASSWORD%"
|
||||
)
|
||||
IF DEFINED SOLR_SSL_KEY_STORE_TYPE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Dsolr.jetty.keystore.type=%SOLR_SSL_KEY_STORE_TYPE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.keystore.type=%SOLR_SSL_KEY_STORE_TYPE%"
|
||||
)
|
||||
|
||||
IF DEFINED SOLR_SSL_TRUST_STORE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Dsolr.jetty.truststore=%SOLR_SSL_TRUST_STORE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.truststore=%SOLR_SSL_TRUST_STORE%"
|
||||
)
|
||||
IF DEFINED SOLR_SSL_TRUST_STORE_PASSWORD (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Dsolr.jetty.truststore.password=%SOLR_SSL_TRUST_STORE_PASSWORD%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.truststore.password=%SOLR_SSL_TRUST_STORE_PASSWORD%"
|
||||
)
|
||||
IF DEFINED SOLR_SSL_TRUST_STORE_TYPE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Dsolr.jetty.truststore.type=%SOLR_SSL_TRUST_STORE_TYPE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.truststore.type=%SOLR_SSL_TRUST_STORE_TYPE%"
|
||||
)
|
||||
|
||||
IF DEFINED SOLR_SSL_NEED_CLIENT_AUTH (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Dsolr.jetty.ssl.needClientAuth=%SOLR_SSL_NEED_CLIENT_AUTH%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.ssl.needClientAuth=%SOLR_SSL_NEED_CLIENT_AUTH%"
|
||||
)
|
||||
IF DEFINED SOLR_SSL_WANT_CLIENT_AUTH (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Dsolr.jetty.ssl.wantClientAuth=%SOLR_SSL_WANT_CLIENT_AUTH%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Dsolr.jetty.ssl.wantClientAuth=%SOLR_SSL_WANT_CLIENT_AUTH%"
|
||||
)
|
||||
|
||||
IF DEFINED SOLR_SSL_CLIENT_KEY_STORE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.keyStore=%SOLR_SSL_CLIENT_KEY_STORE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStore=%SOLR_SSL_CLIENT_KEY_STORE%"
|
||||
|
||||
IF DEFINED SOLR_SSL_CLIENT_KEY_STORE_PASSWORD (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.keyStorePassword=%SOLR_SSL_CLIENT_KEY_STORE_PASSWORD%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStorePassword=%SOLR_SSL_CLIENT_KEY_STORE_PASSWORD%"
|
||||
)
|
||||
IF DEFINED SOLR_SSL_CLIENT_KEY_STORE_TYPE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.keyStoreType=%SOLR_SSL_CLIENT_KEY_STORE_TYPE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStoreType=%SOLR_SSL_CLIENT_KEY_STORE_TYPE%"
|
||||
)
|
||||
) ELSE (
|
||||
IF DEFINED SOLR_SSL_KEY_STORE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.keyStore=%SOLR_SSL_KEY_STORE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStore=%SOLR_SSL_KEY_STORE%"
|
||||
)
|
||||
IF DEFINED SOLR_SSL_KEY_STORE_PASSWORD (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.keyStorePassword=%SOLR_SSL_KEY_STORE_PASSWORD%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStorePassword=%SOLR_SSL_KEY_STORE_PASSWORD%"
|
||||
)
|
||||
IF DEFINED SOLR_SSL_KEY_STORE_TYPE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.keyStoreType=%SOLR_SSL_KEY_STORE_TYPE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.keyStoreType=%SOLR_SSL_KEY_STORE_TYPE%"
|
||||
)
|
||||
)
|
||||
|
||||
IF DEFINED SOLR_SSL_CLIENT_TRUST_STORE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.trustStore=%SOLR_SSL_CLIENT_TRUST_STORE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStore=%SOLR_SSL_CLIENT_TRUST_STORE%"
|
||||
|
||||
IF DEFINED SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.trustStorePassword=%SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStorePassword=%SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD%"
|
||||
)
|
||||
|
||||
IF DEFINED SOLR_SSL_CLIENT_TRUST_STORE_TYPE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.trustStoreType=%SOLR_SSL_CLIENT_TRUST_STORE_TYPE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStoreType=%SOLR_SSL_CLIENT_TRUST_STORE_TYPE%"
|
||||
)
|
||||
) ELSE (
|
||||
IF DEFINED SOLR_SSL_TRUST_STORE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.trustStore=%SOLR_SSL_TRUST_STORE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStore=%SOLR_SSL_TRUST_STORE%"
|
||||
)
|
||||
IF DEFINED SOLR_SSL_TRUST_STORE_PASSWORD (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.trustStorePassword=%SOLR_SSL_TRUST_STORE_PASSWORD%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStorePassword=%SOLR_SSL_TRUST_STORE_PASSWORD%"
|
||||
)
|
||||
IF DEFINED SOLR_SSL_TRUST_STORE_TYPE (
|
||||
set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.trustStoreType=%SOLR_SSL_TRUST_STORE_TYPE%"
|
||||
set "SOLR_SSL_OPTS=!SOLR_SSL_OPTS! -Djavax.net.ssl.trustStoreType=%SOLR_SSL_TRUST_STORE_TYPE%"
|
||||
)
|
||||
)
|
||||
) ELSE (
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.solr.cloud;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.apache.solr.core.CloudConfig;
|
||||
import org.apache.solr.core.CoreContainer;
|
||||
|
||||
public class MockZkController extends ZkController {
|
||||
|
||||
public MockZkController(CoreContainer cc, String zkServerAddress, int zkClientConnectTimeout, CloudConfig cloudConfig,
|
||||
CurrentCoreDescriptorProvider registerOnReconnect) throws InterruptedException, TimeoutException, IOException {
|
||||
super(cc, zkServerAddress, zkClientConnectTimeout, cloudConfig, registerOnReconnect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CoreContainer getCoreContainer() {
|
||||
return super.getCoreContainer();
|
||||
}
|
||||
}
|
|
@ -28,17 +28,20 @@ import java.util.concurrent.Future;
|
|||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import org.apache.solr.SolrTestCaseJ4;
|
||||
import org.apache.solr.cloud.MockZkController;
|
||||
import org.apache.solr.cloud.ZkController;
|
||||
import org.apache.solr.cloud.ZkSolrResourceLoader;
|
||||
import org.apache.solr.cloud.ZkTestServer;
|
||||
import org.apache.solr.common.cloud.SolrZkClient;
|
||||
import org.apache.solr.common.util.ExecutorUtil;
|
||||
import org.apache.solr.common.util.NamedList;
|
||||
import org.apache.solr.core.CoreContainer;
|
||||
import org.apache.solr.core.SolrConfig;
|
||||
import org.apache.solr.core.SolrResourceLoader;
|
||||
import org.apache.solr.util.LogLevel;
|
||||
import org.apache.zookeeper.KeeperException;
|
||||
import org.apache.zookeeper.KeeperException.NoNodeException;
|
||||
import org.apache.zookeeper.KeeperException.SessionExpiredException;
|
||||
import org.apache.zookeeper.Watcher;
|
||||
import org.apache.zookeeper.data.Stat;
|
||||
import org.junit.AfterClass;
|
||||
|
@ -106,14 +109,14 @@ public class TestManagedSchemaThreadSafety extends SolrTestCaseJ4 {
|
|||
|
||||
final String configsetName = "managed-config";//
|
||||
|
||||
try (SolrZkClient client = new SuspendingZkClient(zkServer.getZkHost(), 30)) {
|
||||
try (SolrZkClient client = new SuspendingZkClient(zkServer.getZkHost(), 30000)) {
|
||||
// we can pick any to load configs, I suppose, but here we check
|
||||
client.upConfig(configset("cloud-managed-upgrade"), configsetName);
|
||||
}
|
||||
|
||||
ExecutorService executor = ExecutorUtil.newMDCAwareCachedThreadPool("threadpool");
|
||||
|
||||
try (SolrZkClient raceJudge = new SuspendingZkClient(zkServer.getZkHost(), 30)) {
|
||||
try (SolrZkClient raceJudge = new SuspendingZkClient(zkServer.getZkHost(), 30000)) {
|
||||
|
||||
ZkController zkController = createZkController(raceJudge);
|
||||
|
||||
|
@ -132,14 +135,35 @@ public class TestManagedSchemaThreadSafety extends SolrTestCaseJ4 {
|
|||
}
|
||||
|
||||
private ZkController createZkController(SolrZkClient client) throws KeeperException, InterruptedException {
|
||||
ZkController zkController = mock(ZkController.class,
|
||||
|
||||
CoreContainer mockAlwaysUpCoreContainer = mock(CoreContainer.class,
|
||||
Mockito.withSettings().defaultAnswer(Mockito.CALLS_REAL_METHODS));
|
||||
when(mockAlwaysUpCoreContainer.isShutDown()).thenReturn(Boolean.FALSE); // Allow retry on session expiry
|
||||
|
||||
|
||||
MockZkController zkController = mock(MockZkController.class,
|
||||
Mockito.withSettings().defaultAnswer(Mockito.CALLS_REAL_METHODS));
|
||||
|
||||
when(zkController.getCoreContainer()).thenReturn(mockAlwaysUpCoreContainer);
|
||||
|
||||
when(zkController.getZkClient()).thenReturn(client);
|
||||
Mockito.doAnswer(new Answer<Boolean>() {
|
||||
volatile boolean sessionExpired=false;
|
||||
|
||||
@Override
|
||||
public Boolean answer(InvocationOnMock invocation) throws Throwable {
|
||||
return client.exists((String) invocation.getArguments()[0], true);
|
||||
String path = (String) invocation.getArguments()[0];
|
||||
perhapsExpired();
|
||||
Boolean exists = client.exists(path, true);
|
||||
perhapsExpired();
|
||||
return exists;
|
||||
}
|
||||
|
||||
private void perhapsExpired() throws SessionExpiredException {
|
||||
if (!sessionExpired && rarely()) {
|
||||
sessionExpired = true;
|
||||
throw new KeeperException.SessionExpiredException();
|
||||
}
|
||||
}
|
||||
}).when(zkController).pathExists(Mockito.anyString());
|
||||
return zkController;
|
||||
|
|
Loading…
Reference in New Issue