diff --git a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java index cf227609961..aa21847a374 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/TasksIT.java @@ -19,7 +19,7 @@ package org.elasticsearch.action.admin.cluster.node.tasks; import org.elasticsearch.OpenSearchException; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.action.ActionFuture; @@ -669,7 +669,7 @@ public class TasksIT extends ESIntegTestCase { for (Throwable failure : failures) { assertNotNull( - ExceptionsHelper.unwrap(failure, ElasticsearchTimeoutException.class, ReceiveTimeoutTransportException.class)); + ExceptionsHelper.unwrap(failure, OpenSearchTimeoutException.class, ReceiveTimeoutTransportException.class)); } } finally { // Now we can unblock those requests diff --git a/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateIT.java b/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateIT.java index 59330ab6418..4ecc22cd469 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/update/UpdateIT.java @@ -19,7 +19,7 @@ package org.elasticsearch.update; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.DocWriteResponse; @@ -752,7 +752,7 @@ public class UpdateIT extends ESIntegTestCase { try { waitForOutstandingRequests(TimeValue.timeValueSeconds(60), updateRequestsOutstanding, maxUpdateRequests, "Update"); waitForOutstandingRequests(TimeValue.timeValueSeconds(60), deleteRequestsOutstanding, maxDeleteRequests, "Delete"); - } catch (ElasticsearchTimeoutException ete) { + } catch (OpenSearchTimeoutException ete) { failures.add(ete); } latch.countDown(); @@ -779,7 +779,7 @@ public class UpdateIT extends ESIntegTestCase { //Just keep swimming } } while ((System.currentTimeMillis() - start) < timeOut.getMillis()); - throw new ElasticsearchTimeoutException("Requests were still outstanding after the timeout [" + timeOut + "] for type [" + + throw new OpenSearchTimeoutException("Requests were still outstanding after the timeout [" + timeOut + "] for type [" + name + "]" ); } } diff --git a/server/src/main/java/org/elasticsearch/OpenSearchException.java b/server/src/main/java/org/elasticsearch/OpenSearchException.java index a835afa1840..d5f4784ac2c 100644 --- a/server/src/main/java/org/elasticsearch/OpenSearchException.java +++ b/server/src/main/java/org/elasticsearch/OpenSearchException.java @@ -946,8 +946,8 @@ public class OpenSearchException extends RuntimeException implements ToXContentF org.elasticsearch.cluster.metadata.ProcessClusterEventTimeoutException::new, 116, UNKNOWN_VERSION_ADDED), RETRY_ON_PRIMARY_EXCEPTION(ReplicationOperation.RetryOnPrimaryException.class, ReplicationOperation.RetryOnPrimaryException::new, 117, UNKNOWN_VERSION_ADDED), - ELASTICSEARCH_TIMEOUT_EXCEPTION(org.elasticsearch.ElasticsearchTimeoutException.class, - org.elasticsearch.ElasticsearchTimeoutException::new, 118, UNKNOWN_VERSION_ADDED), + ELASTICSEARCH_TIMEOUT_EXCEPTION(org.elasticsearch.OpenSearchTimeoutException.class, + org.elasticsearch.OpenSearchTimeoutException::new, 118, UNKNOWN_VERSION_ADDED), QUERY_PHASE_EXECUTION_EXCEPTION(org.elasticsearch.search.query.QueryPhaseExecutionException.class, org.elasticsearch.search.query.QueryPhaseExecutionException::new, 119, UNKNOWN_VERSION_ADDED), REPOSITORY_VERIFICATION_EXCEPTION(org.elasticsearch.repositories.RepositoryVerificationException.class, diff --git a/server/src/main/java/org/elasticsearch/ElasticsearchTimeoutException.java b/server/src/main/java/org/elasticsearch/OpenSearchTimeoutException.java similarity index 75% rename from server/src/main/java/org/elasticsearch/ElasticsearchTimeoutException.java rename to server/src/main/java/org/elasticsearch/OpenSearchTimeoutException.java index a20fefaebe1..7f864cfc4d4 100644 --- a/server/src/main/java/org/elasticsearch/ElasticsearchTimeoutException.java +++ b/server/src/main/java/org/elasticsearch/OpenSearchTimeoutException.java @@ -28,20 +28,20 @@ import java.io.IOException; * * */ -public class ElasticsearchTimeoutException extends OpenSearchException { - public ElasticsearchTimeoutException(StreamInput in) throws IOException { +public class OpenSearchTimeoutException extends OpenSearchException { + public OpenSearchTimeoutException(StreamInput in) throws IOException { super(in); } - public ElasticsearchTimeoutException(Throwable cause) { + public OpenSearchTimeoutException(Throwable cause) { super(cause); } - public ElasticsearchTimeoutException(String message, Object... args) { + public OpenSearchTimeoutException(String message, Object... args) { super(message, args); } - public ElasticsearchTimeoutException(String message, Throwable cause, Object... args) { + public OpenSearchTimeoutException(String message, Throwable cause, Object... args) { super(message, cause, args); } } diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java index c011daa1005..800c19193f0 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsAction.java @@ -21,7 +21,7 @@ package org.elasticsearch.action.admin.cluster.configuration; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.OpenSearchException; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.TransportMasterNodeAction; @@ -146,7 +146,7 @@ public class TransportAddVotingConfigExclusionsAction extends TransportMasterNod @Override public void onTimeout(TimeValue timeout) { - listener.onFailure(new ElasticsearchTimeoutException("timed out waiting for voting config exclusions " + listener.onFailure(new OpenSearchTimeoutException("timed out waiting for voting config exclusions " + resolvedExclusions + " to take effect")); } }; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java index c0dfe551934..99e69162771 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsAction.java @@ -21,7 +21,7 @@ package org.elasticsearch.action.admin.cluster.configuration; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.OpenSearchException; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.master.TransportMasterNodeAction; @@ -104,7 +104,7 @@ public class TransportClearVotingConfigExclusionsAction @Override public void onTimeout(TimeValue timeout) { - listener.onFailure(new ElasticsearchTimeoutException( + listener.onFailure(new OpenSearchTimeoutException( "timed out waiting for removal of nodes; if nodes should not be removed, set waitForRemoval to false. " + initialState.getVotingConfigExclusions())); } diff --git a/server/src/main/java/org/elasticsearch/action/support/ListenerTimeouts.java b/server/src/main/java/org/elasticsearch/action/support/ListenerTimeouts.java index 3305ae891a8..76300756f33 100644 --- a/server/src/main/java/org/elasticsearch/action/support/ListenerTimeouts.java +++ b/server/src/main/java/org/elasticsearch/action/support/ListenerTimeouts.java @@ -19,7 +19,7 @@ package org.elasticsearch.action.support; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.threadpool.Scheduler; @@ -33,7 +33,7 @@ public class ListenerTimeouts { /** * Wraps a listener with a listener that can timeout. After the timeout period the * {@link ActionListener#onFailure(Exception)} will be called with a - * {@link ElasticsearchTimeoutException} if the listener has not already been completed. + * {@link OpenSearchTimeoutException} if the listener has not already been completed. * * @param threadPool used to schedule the timeout * @param listener to that can timeout @@ -46,7 +46,7 @@ public class ListenerTimeouts { TimeValue timeout, String executor, String listenerName) { return wrapWithTimeout(threadPool, timeout, executor, listener, (ignore) -> { String timeoutMessage = "[" + listenerName + "]" + " timed out after [" + timeout + "]"; - listener.onFailure(new ElasticsearchTimeoutException(timeoutMessage)); + listener.onFailure(new OpenSearchTimeoutException(timeoutMessage)); }); } diff --git a/server/src/main/java/org/elasticsearch/common/util/concurrent/FutureUtils.java b/server/src/main/java/org/elasticsearch/common/util/concurrent/FutureUtils.java index 236dc9c7162..d4deed72b77 100644 --- a/server/src/main/java/org/elasticsearch/common/util/concurrent/FutureUtils.java +++ b/server/src/main/java/org/elasticsearch/common/util/concurrent/FutureUtils.java @@ -19,7 +19,7 @@ package org.elasticsearch.common.util.concurrent; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.SuppressForbidden; @@ -75,7 +75,7 @@ public class FutureUtils { try { return future.get(timeout, unit); } catch (TimeoutException e) { - throw new ElasticsearchTimeoutException(e); + throw new OpenSearchTimeoutException(e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("Future got interrupted", e); diff --git a/server/src/main/java/org/elasticsearch/gateway/AsyncShardFetch.java b/server/src/main/java/org/elasticsearch/gateway/AsyncShardFetch.java index 8bbed3146c0..407f3140915 100644 --- a/server/src/main/java/org/elasticsearch/gateway/AsyncShardFetch.java +++ b/server/src/main/java/org/elasticsearch/gateway/AsyncShardFetch.java @@ -21,7 +21,7 @@ package org.elasticsearch.gateway; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.FailedNodeException; @@ -217,7 +217,7 @@ public abstract class AsyncShardFetch implements Rel // if the request got rejected or timed out, we need to try it again next time... if (unwrappedCause instanceof EsRejectedExecutionException || unwrappedCause instanceof ReceiveTimeoutTransportException || - unwrappedCause instanceof ElasticsearchTimeoutException) { + unwrappedCause instanceof OpenSearchTimeoutException) { nodeEntry.restartFetching(); } else { logger.warn(() -> new ParameterizedMessage("{}: failed to list shard for {} on node [{}]", diff --git a/server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java b/server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java index e0adf0774b0..d8f8e4b0926 100644 --- a/server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java +++ b/server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java @@ -25,7 +25,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.RateLimiter; import org.elasticsearch.OpenSearchException; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; @@ -383,7 +383,7 @@ public class PeerRecoveryTargetService implements IndexEventListener { @Override public void onTimeout(TimeValue timeout) { // note that we do not use a timeout (see comment above) - listener.onFailure(new ElasticsearchTimeoutException("timed out waiting for mapping updates " + + listener.onFailure(new OpenSearchTimeoutException("timed out waiting for mapping updates " + "(timeout [" + timeout + "])")); } }); diff --git a/server/src/main/java/org/elasticsearch/indices/recovery/RecoveriesCollection.java b/server/src/main/java/org/elasticsearch/indices/recovery/RecoveriesCollection.java index 76b3527073f..a61cf9835b2 100644 --- a/server/src/main/java/org/elasticsearch/indices/recovery/RecoveriesCollection.java +++ b/server/src/main/java/org/elasticsearch/indices/recovery/RecoveriesCollection.java @@ -21,7 +21,7 @@ package org.elasticsearch.indices.recovery; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.concurrent.AbstractRunnable; @@ -279,7 +279,7 @@ public class RecoveriesCollection { if (accessTime == lastSeenAccessTime) { String message = "no activity after [" + checkInterval + "]"; failRecovery(recoveryId, - new RecoveryFailedException(status.state(), message, new ElasticsearchTimeoutException(message)), + new RecoveryFailedException(status.state(), message, new OpenSearchTimeoutException(message)), true // to be safe, we don't know what go stuck ); return; diff --git a/server/src/main/java/org/elasticsearch/node/Node.java b/server/src/main/java/org/elasticsearch/node/Node.java index 8cf5e4aab14..2cfde88a343 100644 --- a/server/src/main/java/org/elasticsearch/node/Node.java +++ b/server/src/main/java/org/elasticsearch/node/Node.java @@ -26,7 +26,7 @@ import org.apache.lucene.util.SetOnce; import org.elasticsearch.Assertions; import org.elasticsearch.Build; import org.elasticsearch.OpenSearchException; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.Version; import org.elasticsearch.action.ActionModule; import org.elasticsearch.action.ActionType; @@ -881,7 +881,7 @@ public class Node implements Closeable { try { latch.await(); } catch (InterruptedException e) { - throw new ElasticsearchTimeoutException("Interrupted while waiting for initial discovery state"); + throw new OpenSearchTimeoutException("Interrupted while waiting for initial discovery state"); } } } diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java index 0533eb6a108..a7c1b16df50 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java @@ -23,7 +23,7 @@ import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.action.ActionRunnable; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; @@ -129,7 +129,7 @@ public class RestGetMappingAction extends BaseRestHandler { public RestResponse buildResponse(final GetMappingsResponse response, final XContentBuilder builder) throws Exception { if (threadPool.relativeTimeInMillis() - startTimeMs > timeout.millis()) { - throw new ElasticsearchTimeoutException("Timed out getting mappings"); + throw new OpenSearchTimeoutException("Timed out getting mappings"); } final ImmutableOpenMap> mappingsByIndex = response.getMappings(); diff --git a/server/src/main/java/org/elasticsearch/tasks/TaskManager.java b/server/src/main/java/org/elasticsearch/tasks/TaskManager.java index 08822c7e6f1..07698806be2 100644 --- a/server/src/main/java/org/elasticsearch/tasks/TaskManager.java +++ b/server/src/main/java/org/elasticsearch/tasks/TaskManager.java @@ -26,9 +26,9 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.message.ParameterizedMessage; import org.apache.lucene.util.SetOnce; import org.elasticsearch.Assertions; -import org.elasticsearch.OpenSearchException; -import org.elasticsearch.ElasticsearchTimeoutException; import org.elasticsearch.ExceptionsHelper; +import org.elasticsearch.OpenSearchException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.cluster.ClusterChangedEvent; @@ -433,7 +433,7 @@ public class TaskManager implements ClusterStateApplier { throw new OpenSearchException("Interrupted waiting for completion of [{}]", e, task); } } - throw new ElasticsearchTimeoutException("Timed out waiting for completion of [{}]", task); + throw new OpenSearchTimeoutException("Timed out waiting for completion of [{}]", task); } private static class CancellableTaskHolder { diff --git a/server/src/main/java/org/elasticsearch/transport/PlainTransportFuture.java b/server/src/main/java/org/elasticsearch/transport/PlainTransportFuture.java index 42c43bbd8a4..3c5713be3ca 100644 --- a/server/src/main/java/org/elasticsearch/transport/PlainTransportFuture.java +++ b/server/src/main/java/org/elasticsearch/transport/PlainTransportFuture.java @@ -20,7 +20,7 @@ package org.elasticsearch.transport; import org.elasticsearch.OpenSearchException; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.util.concurrent.BaseFuture; @@ -59,7 +59,7 @@ public class PlainTransportFuture extends BaseFutur try { return get(timeout, unit); } catch (TimeoutException e) { - throw new ElasticsearchTimeoutException(e); + throw new OpenSearchTimeoutException(e); } catch (InterruptedException e) { throw new IllegalStateException("Future got interrupted", e); } catch (ExecutionException e) { diff --git a/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java b/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java index 8e8f23115c1..577168a4c85 100644 --- a/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java +++ b/server/src/test/java/org/elasticsearch/ExceptionSerializationTests.java @@ -789,7 +789,7 @@ public class ExceptionSerializationTests extends ESTestCase { ids.put(115, org.elasticsearch.index.translog.TranslogException.class); ids.put(116, org.elasticsearch.cluster.metadata.ProcessClusterEventTimeoutException.class); ids.put(117, ReplicationOperation.RetryOnPrimaryException.class); - ids.put(118, org.elasticsearch.ElasticsearchTimeoutException.class); + ids.put(118, org.elasticsearch.OpenSearchTimeoutException.class); ids.put(119, org.elasticsearch.search.query.QueryPhaseExecutionException.class); ids.put(120, org.elasticsearch.repositories.RepositoryVerificationException.class); ids.put(121, org.elasticsearch.search.aggregations.InvalidAggregationPathException.class); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java index 6092e371024..fc2f14060af 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportAddVotingConfigExclusionsActionTests.java @@ -19,7 +19,7 @@ package org.elasticsearch.action.admin.cluster.configuration; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.Version; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.cluster.ClusterName; @@ -506,7 +506,7 @@ public class TransportAddVotingConfigExclusionsActionTests extends ESTestCase { assertTrue(countDownLatch.await(30, TimeUnit.SECONDS)); final Throwable rootCause = exceptionHolder.get().getRootCause(); - assertThat(rootCause,instanceOf(ElasticsearchTimeoutException.class)); + assertThat(rootCause,instanceOf(OpenSearchTimeoutException.class)); assertThat(rootCause.getMessage(), startsWith("timed out waiting for voting config exclusions [{other1}")); assertWarnings(AddVotingConfigExclusionsRequest.DEPRECATION_MESSAGE); diff --git a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java b/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java index e7fd68b6c0d..bab05532376 100644 --- a/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java +++ b/server/src/test/java/org/elasticsearch/action/admin/cluster/configuration/TransportClearVotingConfigExclusionsActionTests.java @@ -19,7 +19,7 @@ package org.elasticsearch.action.admin.cluster.configuration; import org.apache.lucene.util.SetOnce; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.Version; import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.cluster.ClusterName; @@ -149,7 +149,7 @@ public class TransportClearVotingConfigExclusionsActionTests extends ESTestCase assertThat(clusterService.getClusterApplierService().state().getVotingConfigExclusions(), containsInAnyOrder(otherNode1Exclusion, otherNode2Exclusion)); final Throwable rootCause = responseHolder.get().getRootCause(); - assertThat(rootCause, instanceOf(ElasticsearchTimeoutException.class)); + assertThat(rootCause, instanceOf(OpenSearchTimeoutException.class)); assertThat(rootCause.getMessage(), startsWith("timed out waiting for removal of nodes; if nodes should not be removed, set waitForRemoval to false. [")); } diff --git a/server/src/test/java/org/elasticsearch/action/support/ListenerTimeoutsTests.java b/server/src/test/java/org/elasticsearch/action/support/ListenerTimeoutsTests.java index d5e3f0031c7..2b17d83a376 100644 --- a/server/src/test/java/org/elasticsearch/action/support/ListenerTimeoutsTests.java +++ b/server/src/test/java/org/elasticsearch/action/support/ListenerTimeoutsTests.java @@ -19,7 +19,7 @@ package org.elasticsearch.action.support; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.cluster.coordination.DeterministicTaskQueue; import org.elasticsearch.common.settings.Settings; @@ -62,7 +62,7 @@ public class ListenerTimeoutsTests extends ESTestCase { wrapped.onFailure(new IOException("incorrect exception")); assertFalse(success.get()); - assertThat(exception.get(), instanceOf(ElasticsearchTimeoutException.class)); + assertThat(exception.get(), instanceOf(OpenSearchTimeoutException.class)); } public void testFinishNormallyBeforeTimeout() { diff --git a/server/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java b/server/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java index 0655ca4853c..a4865bd9f20 100644 --- a/server/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java +++ b/server/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java @@ -19,7 +19,7 @@ package org.elasticsearch.action.support; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; @@ -245,7 +245,7 @@ public class TransportActionFilterChainTests extends ESTestCase { @Override public void execute(Task task, String action, Request request, ActionListener listener, ActionFilterChain actionFilterChain) { - listener.onFailure(new ElasticsearchTimeoutException("")); + listener.onFailure(new OpenSearchTimeoutException("")); } } } diff --git a/server/src/test/java/org/elasticsearch/cluster/NodeConnectionsServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/NodeConnectionsServiceTests.java index 75a8458cb47..aedfec174cb 100644 --- a/server/src/test/java/org/elasticsearch/cluster/NodeConnectionsServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/NodeConnectionsServiceTests.java @@ -21,7 +21,7 @@ package org.elasticsearch.cluster; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; -import org.elasticsearch.ElasticsearchTimeoutException; +import org.elasticsearch.OpenSearchTimeoutException; import org.elasticsearch.Version; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.PlainActionFuture; @@ -258,7 +258,7 @@ public class NodeConnectionsServiceTests extends ESTestCase { // however, now node0 is considered to be a new node so we will block on a subsequent attempt to connect to it final PlainActionFuture future3 = new PlainActionFuture<>(); service.connectToNodes(nodes01, () -> future3.onResponse(null)); - expectThrows(ElasticsearchTimeoutException.class, () -> future3.actionGet(timeValueMillis(scaledRandomIntBetween(1, 1000)))); + expectThrows(OpenSearchTimeoutException.class, () -> future3.actionGet(timeValueMillis(scaledRandomIntBetween(1, 1000)))); // once the connection is unblocked we successfully connect to it. connectionBarrier.await(10, TimeUnit.SECONDS); @@ -288,7 +288,7 @@ public class NodeConnectionsServiceTests extends ESTestCase { // if we disconnect from a node while blocked trying to connect to it then the listener is notified final PlainActionFuture future6 = new PlainActionFuture<>(); service.connectToNodes(nodes01, () -> future6.onResponse(null)); - expectThrows(ElasticsearchTimeoutException.class, () -> future6.actionGet(timeValueMillis(scaledRandomIntBetween(1, 1000)))); + expectThrows(OpenSearchTimeoutException.class, () -> future6.actionGet(timeValueMillis(scaledRandomIntBetween(1, 1000)))); service.disconnectFromNodesExcept(nodes1); future6.actionGet(); // completed even though the connection attempt is still blocked