[Rename] ElasticsearchTimeoutException class in server module (#173)
This commit refactors the ElasticsearchTimeoutException class in the server module to OpenSearchTimeoutException. References and usages throught the rest of the codebase are fully refactored. Signed-off-by: Nicholas Knize <nknize@amazon.com>
This commit is contained in:
parent
64d7e7e9ca
commit
7788250e9e
|
@ -19,7 +19,7 @@
|
||||||
package org.elasticsearch.action.admin.cluster.node.tasks;
|
package org.elasticsearch.action.admin.cluster.node.tasks;
|
||||||
|
|
||||||
import org.elasticsearch.OpenSearchException;
|
import org.elasticsearch.OpenSearchException;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.ResourceNotFoundException;
|
import org.elasticsearch.ResourceNotFoundException;
|
||||||
import org.elasticsearch.action.ActionFuture;
|
import org.elasticsearch.action.ActionFuture;
|
||||||
|
@ -669,7 +669,7 @@ public class TasksIT extends ESIntegTestCase {
|
||||||
|
|
||||||
for (Throwable failure : failures) {
|
for (Throwable failure : failures) {
|
||||||
assertNotNull(
|
assertNotNull(
|
||||||
ExceptionsHelper.unwrap(failure, ElasticsearchTimeoutException.class, ReceiveTimeoutTransportException.class));
|
ExceptionsHelper.unwrap(failure, OpenSearchTimeoutException.class, ReceiveTimeoutTransportException.class));
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
// Now we can unblock those requests
|
// Now we can unblock those requests
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.update;
|
package org.elasticsearch.update;
|
||||||
|
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.ActionRequestValidationException;
|
import org.elasticsearch.action.ActionRequestValidationException;
|
||||||
import org.elasticsearch.action.DocWriteResponse;
|
import org.elasticsearch.action.DocWriteResponse;
|
||||||
|
@ -752,7 +752,7 @@ public class UpdateIT extends ESIntegTestCase {
|
||||||
try {
|
try {
|
||||||
waitForOutstandingRequests(TimeValue.timeValueSeconds(60), updateRequestsOutstanding, maxUpdateRequests, "Update");
|
waitForOutstandingRequests(TimeValue.timeValueSeconds(60), updateRequestsOutstanding, maxUpdateRequests, "Update");
|
||||||
waitForOutstandingRequests(TimeValue.timeValueSeconds(60), deleteRequestsOutstanding, maxDeleteRequests, "Delete");
|
waitForOutstandingRequests(TimeValue.timeValueSeconds(60), deleteRequestsOutstanding, maxDeleteRequests, "Delete");
|
||||||
} catch (ElasticsearchTimeoutException ete) {
|
} catch (OpenSearchTimeoutException ete) {
|
||||||
failures.add(ete);
|
failures.add(ete);
|
||||||
}
|
}
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
|
@ -779,7 +779,7 @@ public class UpdateIT extends ESIntegTestCase {
|
||||||
//Just keep swimming
|
//Just keep swimming
|
||||||
}
|
}
|
||||||
} while ((System.currentTimeMillis() - start) < timeOut.getMillis());
|
} 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 + "]" );
|
name + "]" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -946,8 +946,8 @@ public class OpenSearchException extends RuntimeException implements ToXContentF
|
||||||
org.elasticsearch.cluster.metadata.ProcessClusterEventTimeoutException::new, 116, UNKNOWN_VERSION_ADDED),
|
org.elasticsearch.cluster.metadata.ProcessClusterEventTimeoutException::new, 116, UNKNOWN_VERSION_ADDED),
|
||||||
RETRY_ON_PRIMARY_EXCEPTION(ReplicationOperation.RetryOnPrimaryException.class,
|
RETRY_ON_PRIMARY_EXCEPTION(ReplicationOperation.RetryOnPrimaryException.class,
|
||||||
ReplicationOperation.RetryOnPrimaryException::new, 117, UNKNOWN_VERSION_ADDED),
|
ReplicationOperation.RetryOnPrimaryException::new, 117, UNKNOWN_VERSION_ADDED),
|
||||||
ELASTICSEARCH_TIMEOUT_EXCEPTION(org.elasticsearch.ElasticsearchTimeoutException.class,
|
ELASTICSEARCH_TIMEOUT_EXCEPTION(org.elasticsearch.OpenSearchTimeoutException.class,
|
||||||
org.elasticsearch.ElasticsearchTimeoutException::new, 118, UNKNOWN_VERSION_ADDED),
|
org.elasticsearch.OpenSearchTimeoutException::new, 118, UNKNOWN_VERSION_ADDED),
|
||||||
QUERY_PHASE_EXECUTION_EXCEPTION(org.elasticsearch.search.query.QueryPhaseExecutionException.class,
|
QUERY_PHASE_EXECUTION_EXCEPTION(org.elasticsearch.search.query.QueryPhaseExecutionException.class,
|
||||||
org.elasticsearch.search.query.QueryPhaseExecutionException::new, 119, UNKNOWN_VERSION_ADDED),
|
org.elasticsearch.search.query.QueryPhaseExecutionException::new, 119, UNKNOWN_VERSION_ADDED),
|
||||||
REPOSITORY_VERIFICATION_EXCEPTION(org.elasticsearch.repositories.RepositoryVerificationException.class,
|
REPOSITORY_VERIFICATION_EXCEPTION(org.elasticsearch.repositories.RepositoryVerificationException.class,
|
||||||
|
|
|
@ -28,20 +28,20 @@ import java.io.IOException;
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ElasticsearchTimeoutException extends OpenSearchException {
|
public class OpenSearchTimeoutException extends OpenSearchException {
|
||||||
public ElasticsearchTimeoutException(StreamInput in) throws IOException {
|
public OpenSearchTimeoutException(StreamInput in) throws IOException {
|
||||||
super(in);
|
super(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ElasticsearchTimeoutException(Throwable cause) {
|
public OpenSearchTimeoutException(Throwable cause) {
|
||||||
super(cause);
|
super(cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ElasticsearchTimeoutException(String message, Object... args) {
|
public OpenSearchTimeoutException(String message, Object... args) {
|
||||||
super(message, args);
|
super(message, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ElasticsearchTimeoutException(String message, Throwable cause, Object... args) {
|
public OpenSearchTimeoutException(String message, Throwable cause, Object... args) {
|
||||||
super(message, cause, args);
|
super(message, cause, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -21,7 +21,7 @@ package org.elasticsearch.action.admin.cluster.configuration;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.OpenSearchException;
|
import org.elasticsearch.OpenSearchException;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
|
@ -146,7 +146,7 @@ public class TransportAddVotingConfigExclusionsAction extends TransportMasterNod
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTimeout(TimeValue timeout) {
|
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"));
|
+ resolvedExclusions + " to take effect"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,7 +21,7 @@ package org.elasticsearch.action.admin.cluster.configuration;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.OpenSearchException;
|
import org.elasticsearch.OpenSearchException;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
import org.elasticsearch.action.support.master.TransportMasterNodeAction;
|
||||||
|
@ -104,7 +104,7 @@ public class TransportClearVotingConfigExclusionsAction
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTimeout(TimeValue timeout) {
|
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. "
|
"timed out waiting for removal of nodes; if nodes should not be removed, set waitForRemoval to false. "
|
||||||
+ initialState.getVotingConfigExclusions()));
|
+ initialState.getVotingConfigExclusions()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.action.support;
|
package org.elasticsearch.action.support;
|
||||||
|
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.threadpool.Scheduler;
|
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
|
* Wraps a listener with a listener that can timeout. After the timeout period the
|
||||||
* {@link ActionListener#onFailure(Exception)} will be called with a
|
* {@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 threadPool used to schedule the timeout
|
||||||
* @param listener to that can timeout
|
* @param listener to that can timeout
|
||||||
|
@ -46,7 +46,7 @@ public class ListenerTimeouts {
|
||||||
TimeValue timeout, String executor, String listenerName) {
|
TimeValue timeout, String executor, String listenerName) {
|
||||||
return wrapWithTimeout(threadPool, timeout, executor, listener, (ignore) -> {
|
return wrapWithTimeout(threadPool, timeout, executor, listener, (ignore) -> {
|
||||||
String timeoutMessage = "[" + listenerName + "]" + " timed out after [" + timeout + "]";
|
String timeoutMessage = "[" + listenerName + "]" + " timed out after [" + timeout + "]";
|
||||||
listener.onFailure(new ElasticsearchTimeoutException(timeoutMessage));
|
listener.onFailure(new OpenSearchTimeoutException(timeoutMessage));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.common.util.concurrent;
|
package org.elasticsearch.common.util.concurrent;
|
||||||
|
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.SuppressForbidden;
|
import org.elasticsearch.common.SuppressForbidden;
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ public class FutureUtils {
|
||||||
try {
|
try {
|
||||||
return future.get(timeout, unit);
|
return future.get(timeout, unit);
|
||||||
} catch (TimeoutException e) {
|
} catch (TimeoutException e) {
|
||||||
throw new ElasticsearchTimeoutException(e);
|
throw new OpenSearchTimeoutException(e);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
throw new IllegalStateException("Future got interrupted", e);
|
throw new IllegalStateException("Future got interrupted", e);
|
||||||
|
|
|
@ -21,7 +21,7 @@ package org.elasticsearch.gateway;
|
||||||
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.FailedNodeException;
|
import org.elasticsearch.action.FailedNodeException;
|
||||||
|
@ -217,7 +217,7 @@ public abstract class AsyncShardFetch<T extends BaseNodeResponse> implements Rel
|
||||||
// if the request got rejected or timed out, we need to try it again next time...
|
// if the request got rejected or timed out, we need to try it again next time...
|
||||||
if (unwrappedCause instanceof EsRejectedExecutionException ||
|
if (unwrappedCause instanceof EsRejectedExecutionException ||
|
||||||
unwrappedCause instanceof ReceiveTimeoutTransportException ||
|
unwrappedCause instanceof ReceiveTimeoutTransportException ||
|
||||||
unwrappedCause instanceof ElasticsearchTimeoutException) {
|
unwrappedCause instanceof OpenSearchTimeoutException) {
|
||||||
nodeEntry.restartFetching();
|
nodeEntry.restartFetching();
|
||||||
} else {
|
} else {
|
||||||
logger.warn(() -> new ParameterizedMessage("{}: failed to list shard for {} on node [{}]",
|
logger.warn(() -> new ParameterizedMessage("{}: failed to list shard for {} on node [{}]",
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.apache.lucene.store.AlreadyClosedException;
|
import org.apache.lucene.store.AlreadyClosedException;
|
||||||
import org.apache.lucene.store.RateLimiter;
|
import org.apache.lucene.store.RateLimiter;
|
||||||
import org.elasticsearch.OpenSearchException;
|
import org.elasticsearch.OpenSearchException;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
|
@ -383,7 +383,7 @@ public class PeerRecoveryTargetService implements IndexEventListener {
|
||||||
@Override
|
@Override
|
||||||
public void onTimeout(TimeValue timeout) {
|
public void onTimeout(TimeValue timeout) {
|
||||||
// note that we do not use a timeout (see comment above)
|
// 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 + "])"));
|
"(timeout [" + timeout + "])"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,7 +21,7 @@ package org.elasticsearch.indices.recovery;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
|
import org.elasticsearch.common.util.concurrent.AbstractRunnable;
|
||||||
|
@ -279,7 +279,7 @@ public class RecoveriesCollection {
|
||||||
if (accessTime == lastSeenAccessTime) {
|
if (accessTime == lastSeenAccessTime) {
|
||||||
String message = "no activity after [" + checkInterval + "]";
|
String message = "no activity after [" + checkInterval + "]";
|
||||||
failRecovery(recoveryId,
|
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
|
true // to be safe, we don't know what go stuck
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.apache.lucene.util.SetOnce;
|
||||||
import org.elasticsearch.Assertions;
|
import org.elasticsearch.Assertions;
|
||||||
import org.elasticsearch.Build;
|
import org.elasticsearch.Build;
|
||||||
import org.elasticsearch.OpenSearchException;
|
import org.elasticsearch.OpenSearchException;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.action.ActionModule;
|
import org.elasticsearch.action.ActionModule;
|
||||||
import org.elasticsearch.action.ActionType;
|
import org.elasticsearch.action.ActionType;
|
||||||
|
@ -881,7 +881,7 @@ public class Node implements Closeable {
|
||||||
try {
|
try {
|
||||||
latch.await();
|
latch.await();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new ElasticsearchTimeoutException("Interrupted while waiting for initial discovery state");
|
throw new OpenSearchTimeoutException("Interrupted while waiting for initial discovery state");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import com.carrotsearch.hppc.cursors.ObjectCursor;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.action.ActionRunnable;
|
import org.elasticsearch.action.ActionRunnable;
|
||||||
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest;
|
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest;
|
||||||
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
|
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
|
||||||
|
@ -129,7 +129,7 @@ public class RestGetMappingAction extends BaseRestHandler {
|
||||||
public RestResponse buildResponse(final GetMappingsResponse response,
|
public RestResponse buildResponse(final GetMappingsResponse response,
|
||||||
final XContentBuilder builder) throws Exception {
|
final XContentBuilder builder) throws Exception {
|
||||||
if (threadPool.relativeTimeInMillis() - startTimeMs > timeout.millis()) {
|
if (threadPool.relativeTimeInMillis() - startTimeMs > timeout.millis()) {
|
||||||
throw new ElasticsearchTimeoutException("Timed out getting mappings");
|
throw new OpenSearchTimeoutException("Timed out getting mappings");
|
||||||
}
|
}
|
||||||
final ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetadata>> mappingsByIndex =
|
final ImmutableOpenMap<String, ImmutableOpenMap<String, MappingMetadata>> mappingsByIndex =
|
||||||
response.getMappings();
|
response.getMappings();
|
||||||
|
|
|
@ -26,9 +26,9 @@ import org.apache.logging.log4j.Logger;
|
||||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||||
import org.apache.lucene.util.SetOnce;
|
import org.apache.lucene.util.SetOnce;
|
||||||
import org.elasticsearch.Assertions;
|
import org.elasticsearch.Assertions;
|
||||||
import org.elasticsearch.OpenSearchException;
|
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
|
||||||
import org.elasticsearch.ExceptionsHelper;
|
import org.elasticsearch.ExceptionsHelper;
|
||||||
|
import org.elasticsearch.OpenSearchException;
|
||||||
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.ActionResponse;
|
import org.elasticsearch.action.ActionResponse;
|
||||||
import org.elasticsearch.cluster.ClusterChangedEvent;
|
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 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 {
|
private static class CancellableTaskHolder {
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
package org.elasticsearch.transport;
|
package org.elasticsearch.transport;
|
||||||
|
|
||||||
import org.elasticsearch.OpenSearchException;
|
import org.elasticsearch.OpenSearchException;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.util.concurrent.BaseFuture;
|
import org.elasticsearch.common.util.concurrent.BaseFuture;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class PlainTransportFuture<V extends TransportResponse> extends BaseFutur
|
||||||
try {
|
try {
|
||||||
return get(timeout, unit);
|
return get(timeout, unit);
|
||||||
} catch (TimeoutException e) {
|
} catch (TimeoutException e) {
|
||||||
throw new ElasticsearchTimeoutException(e);
|
throw new OpenSearchTimeoutException(e);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new IllegalStateException("Future got interrupted", e);
|
throw new IllegalStateException("Future got interrupted", e);
|
||||||
} catch (ExecutionException e) {
|
} catch (ExecutionException e) {
|
||||||
|
|
|
@ -789,7 +789,7 @@ public class ExceptionSerializationTests extends ESTestCase {
|
||||||
ids.put(115, org.elasticsearch.index.translog.TranslogException.class);
|
ids.put(115, org.elasticsearch.index.translog.TranslogException.class);
|
||||||
ids.put(116, org.elasticsearch.cluster.metadata.ProcessClusterEventTimeoutException.class);
|
ids.put(116, org.elasticsearch.cluster.metadata.ProcessClusterEventTimeoutException.class);
|
||||||
ids.put(117, ReplicationOperation.RetryOnPrimaryException.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(119, org.elasticsearch.search.query.QueryPhaseExecutionException.class);
|
||||||
ids.put(120, org.elasticsearch.repositories.RepositoryVerificationException.class);
|
ids.put(120, org.elasticsearch.repositories.RepositoryVerificationException.class);
|
||||||
ids.put(121, org.elasticsearch.search.aggregations.InvalidAggregationPathException.class);
|
ids.put(121, org.elasticsearch.search.aggregations.InvalidAggregationPathException.class);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
package org.elasticsearch.action.admin.cluster.configuration;
|
package org.elasticsearch.action.admin.cluster.configuration;
|
||||||
|
|
||||||
import org.apache.lucene.util.SetOnce;
|
import org.apache.lucene.util.SetOnce;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.cluster.ClusterName;
|
import org.elasticsearch.cluster.ClusterName;
|
||||||
|
@ -506,7 +506,7 @@ public class TransportAddVotingConfigExclusionsActionTests extends ESTestCase {
|
||||||
|
|
||||||
assertTrue(countDownLatch.await(30, TimeUnit.SECONDS));
|
assertTrue(countDownLatch.await(30, TimeUnit.SECONDS));
|
||||||
final Throwable rootCause = exceptionHolder.get().getRootCause();
|
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}"));
|
assertThat(rootCause.getMessage(), startsWith("timed out waiting for voting config exclusions [{other1}"));
|
||||||
assertWarnings(AddVotingConfigExclusionsRequest.DEPRECATION_MESSAGE);
|
assertWarnings(AddVotingConfigExclusionsRequest.DEPRECATION_MESSAGE);
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
package org.elasticsearch.action.admin.cluster.configuration;
|
package org.elasticsearch.action.admin.cluster.configuration;
|
||||||
|
|
||||||
import org.apache.lucene.util.SetOnce;
|
import org.apache.lucene.util.SetOnce;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.action.support.ActionFilters;
|
import org.elasticsearch.action.support.ActionFilters;
|
||||||
import org.elasticsearch.cluster.ClusterName;
|
import org.elasticsearch.cluster.ClusterName;
|
||||||
|
@ -149,7 +149,7 @@ public class TransportClearVotingConfigExclusionsActionTests extends ESTestCase
|
||||||
assertThat(clusterService.getClusterApplierService().state().getVotingConfigExclusions(),
|
assertThat(clusterService.getClusterApplierService().state().getVotingConfigExclusions(),
|
||||||
containsInAnyOrder(otherNode1Exclusion, otherNode2Exclusion));
|
containsInAnyOrder(otherNode1Exclusion, otherNode2Exclusion));
|
||||||
final Throwable rootCause = responseHolder.get().getRootCause();
|
final Throwable rootCause = responseHolder.get().getRootCause();
|
||||||
assertThat(rootCause, instanceOf(ElasticsearchTimeoutException.class));
|
assertThat(rootCause, instanceOf(OpenSearchTimeoutException.class));
|
||||||
assertThat(rootCause.getMessage(),
|
assertThat(rootCause.getMessage(),
|
||||||
startsWith("timed out waiting for removal of nodes; if nodes should not be removed, set waitForRemoval to false. ["));
|
startsWith("timed out waiting for removal of nodes; if nodes should not be removed, set waitForRemoval to false. ["));
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.action.support;
|
package org.elasticsearch.action.support;
|
||||||
|
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.cluster.coordination.DeterministicTaskQueue;
|
import org.elasticsearch.cluster.coordination.DeterministicTaskQueue;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
|
@ -62,7 +62,7 @@ public class ListenerTimeoutsTests extends ESTestCase {
|
||||||
wrapped.onFailure(new IOException("incorrect exception"));
|
wrapped.onFailure(new IOException("incorrect exception"));
|
||||||
|
|
||||||
assertFalse(success.get());
|
assertFalse(success.get());
|
||||||
assertThat(exception.get(), instanceOf(ElasticsearchTimeoutException.class));
|
assertThat(exception.get(), instanceOf(OpenSearchTimeoutException.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFinishNormallyBeforeTimeout() {
|
public void testFinishNormallyBeforeTimeout() {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
package org.elasticsearch.action.support;
|
package org.elasticsearch.action.support;
|
||||||
|
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.ActionRequest;
|
import org.elasticsearch.action.ActionRequest;
|
||||||
import org.elasticsearch.action.ActionRequestValidationException;
|
import org.elasticsearch.action.ActionRequestValidationException;
|
||||||
|
@ -245,7 +245,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
||||||
@Override
|
@Override
|
||||||
public <Request extends ActionRequest, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
public <Request extends ActionRequest, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||||
ActionListener<Response> listener, ActionFilterChain<Request, Response> actionFilterChain) {
|
ActionListener<Response> listener, ActionFilterChain<Request, Response> actionFilterChain) {
|
||||||
listener.onFailure(new ElasticsearchTimeoutException(""));
|
listener.onFailure(new OpenSearchTimeoutException(""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ package org.elasticsearch.cluster;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.Level;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.elasticsearch.ElasticsearchTimeoutException;
|
import org.elasticsearch.OpenSearchTimeoutException;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.action.ActionListener;
|
import org.elasticsearch.action.ActionListener;
|
||||||
import org.elasticsearch.action.support.PlainActionFuture;
|
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
|
// however, now node0 is considered to be a new node so we will block on a subsequent attempt to connect to it
|
||||||
final PlainActionFuture<Void> future3 = new PlainActionFuture<>();
|
final PlainActionFuture<Void> future3 = new PlainActionFuture<>();
|
||||||
service.connectToNodes(nodes01, () -> future3.onResponse(null));
|
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.
|
// once the connection is unblocked we successfully connect to it.
|
||||||
connectionBarrier.await(10, TimeUnit.SECONDS);
|
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
|
// if we disconnect from a node while blocked trying to connect to it then the listener is notified
|
||||||
final PlainActionFuture<Void> future6 = new PlainActionFuture<>();
|
final PlainActionFuture<Void> future6 = new PlainActionFuture<>();
|
||||||
service.connectToNodes(nodes01, () -> future6.onResponse(null));
|
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);
|
service.disconnectFromNodesExcept(nodes1);
|
||||||
future6.actionGet(); // completed even though the connection attempt is still blocked
|
future6.actionGet(); // completed even though the connection attempt is still blocked
|
||||||
|
|
Loading…
Reference in New Issue