better transport exception handling, refactor out an action based transport exception, and don't fill stack trace only for remote ones
This commit is contained in:
parent
ed99787c8e
commit
e44604b441
|
@ -120,7 +120,7 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
|
|||
latch.countDown();
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.warn("[cluster_shutdown]: received failed shutdown response from [{}]", exp, node);
|
||||
latch.countDown();
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
|
|||
logger.trace("[cluster_shutdown]: received shutdown response from master");
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.warn("[cluster_shutdown]: received failed shutdown response master", exp);
|
||||
}
|
||||
});
|
||||
|
@ -183,7 +183,7 @@ public class TransportNodesShutdownAction extends TransportMasterNodeOperationAc
|
|||
latch.countDown();
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.warn("[partial_cluster_shutdown]: received failed shutdown response from [{}]", exp, node);
|
||||
latch.countDown();
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ public abstract class TransportBroadcastOperationAction<Request extends Broadcas
|
|||
onOperation(shard, response, false);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException e) {
|
||||
@Override public void handleException(TransportException e) {
|
||||
onOperation(shard, shardIt, e, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ public abstract class TransportMasterNodeOperationAction<Request extends MasterN
|
|||
listener.onResponse(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(final RemoteTransportException exp) {
|
||||
@Override public void handleException(final TransportException exp) {
|
||||
if (exp.unwrapCause() instanceof ConnectTransportException) {
|
||||
// we want to retry here a bit to see if a new master is elected
|
||||
clusterService.add(request.masterNodeTimeout(), new TimeoutClusterStateListener() {
|
||||
|
@ -205,7 +205,7 @@ public abstract class TransportMasterNodeOperationAction<Request extends MasterN
|
|||
}
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
try {
|
||||
channel.sendResponse(exp);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -164,7 +164,7 @@ public abstract class TransportNodesOperationAction<Request extends NodesOperati
|
|||
onOperation(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
onFailure(node.id(), exp);
|
||||
}
|
||||
|
||||
|
|
|
@ -325,7 +325,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
|||
listener.onResponse(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
// if we got disconnected from the node, or the node / shard is not in the right state (being closed)
|
||||
if (exp.unwrapCause() instanceof ConnectTransportException || exp.unwrapCause() instanceof NodeClosedException ||
|
||||
exp.unwrapCause() instanceof IllegalIndexShardStateException) {
|
||||
|
@ -547,7 +547,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
|||
finishIfPossible();
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
if (!ignoreReplicaException(exp.unwrapCause())) {
|
||||
logger.warn("Failed to perform " + transportAction() + " on replica " + shards.shardId(), exp);
|
||||
shardStateAction.shardFailed(shard, "Failed to perform [" + transportAction() + "] on replica, message [" + detailedMessage(exp) + "]");
|
||||
|
|
|
@ -188,7 +188,7 @@ public abstract class TransportSingleOperationAction<Request extends SingleOpera
|
|||
}
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
onFailure(shard, exp);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.elasticsearch.common.unit.TimeValue;
|
|||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.BaseTransportResponseHandler;
|
||||
import org.elasticsearch.transport.ConnectTransportException;
|
||||
import org.elasticsearch.transport.RemoteTransportException;
|
||||
import org.elasticsearch.transport.TransportException;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
@ -194,7 +194,7 @@ public class TransportClientNodesService extends AbstractComponent implements Cl
|
|||
latch.countDown();
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.debug("Failed to get node info from " + listedNode + ", removed from nodes list", exp);
|
||||
latch.countDown();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
|
|||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.transport.BaseTransportResponseHandler;
|
||||
import org.elasticsearch.transport.RemoteTransportException;
|
||||
import org.elasticsearch.transport.TransportException;
|
||||
import org.elasticsearch.transport.TransportRequestOptions;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
|
@ -77,7 +77,7 @@ public abstract class BaseClientTransportAction<Request extends ActionRequest, R
|
|||
listener.onResponse(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
listener.onFailure(exp);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public class ShardStateAction extends AbstractComponent {
|
|||
} else {
|
||||
transportService.sendRequest(clusterService.state().nodes().masterNode(),
|
||||
ShardFailedTransportHandler.ACTION, new ShardRoutingEntry(shardRouting, reason), new VoidTransportResponseHandler() {
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.warn("failed to send failed shard to [{}]", exp, clusterService.state().nodes().masterNode());
|
||||
}
|
||||
});
|
||||
|
@ -104,7 +104,7 @@ public class ShardStateAction extends AbstractComponent {
|
|||
} else {
|
||||
transportService.sendRequest(clusterService.state().nodes().masterNode(),
|
||||
ShardStartedTransportHandler.ACTION, new ShardRoutingEntry(shardRouting, reason), new VoidTransportResponseHandler() {
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.warn("failed to send shard started to [{}]", exp, clusterService.state().nodes().masterNode());
|
||||
}
|
||||
});
|
||||
|
|
|
@ -281,7 +281,7 @@ public class MasterFaultDetection extends AbstractComponent {
|
|||
}
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
if (!running) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -215,7 +215,7 @@ public class NodesFaultDetection extends AbstractComponent {
|
|||
}
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
// check if the master node did not get switched on us...
|
||||
if (!running) {
|
||||
return;
|
||||
|
|
|
@ -350,7 +350,7 @@ public class MulticastZenPing extends AbstractLifecycleComponent<ZenPing> implem
|
|||
try {
|
||||
transportService.connectToNode(requestingNode);
|
||||
transportService.sendRequest(requestingNode, MulticastPingResponseRequestHandler.ACTION, multicastPingResponse, new VoidTransportResponseHandler(false) {
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.warn("failed to receive confirmation on sent ping response to [{}]", exp, requestingNode);
|
||||
}
|
||||
});
|
||||
|
@ -361,7 +361,7 @@ public class MulticastZenPing extends AbstractLifecycleComponent<ZenPing> implem
|
|||
});
|
||||
} else {
|
||||
transportService.sendRequest(requestingNode, MulticastPingResponseRequestHandler.ACTION, multicastPingResponse, new VoidTransportResponseHandler(false) {
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.warn("failed to receive confirmation on sent ping response to [{}]", exp, requestingNode);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -229,7 +229,7 @@ public class UnicastZenPing extends AbstractLifecycleComponent<ZenPing> implemen
|
|||
}
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
latch.countDown();
|
||||
if (exp instanceof ConnectTransportException) {
|
||||
// ok, not connected...
|
||||
|
|
|
@ -68,7 +68,7 @@ public class PublishClusterStateAction extends AbstractComponent {
|
|||
continue;
|
||||
}
|
||||
transportService.sendRequest(node, PublishClusterStateRequestHandler.ACTION, new PublishClusterStateRequest(clusterState), new VoidTransportResponseHandler(false) {
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.debug("failed to send cluster state to [{}], should be detected as failed soon...", exp, node);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -77,7 +77,7 @@ public class PublishRiverClusterStateAction extends AbstractComponent {
|
|||
}
|
||||
|
||||
transportService.sendRequest(node, PublishClusterStateRequestHandler.ACTION, new PublishClusterStateRequest(clusterState), new VoidTransportResponseHandler(false) {
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.debug("failed to send cluster state to [{}], should be detected as failed soon...", exp, node);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -57,7 +57,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
|
|||
this.logger = logger;
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
logger.warn("Failed to send release search context", exp);
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
|
|||
listener.onResult(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
listener.onFailure(exp);
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
|
|||
listener.onResult(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
listener.onFailure(exp);
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
|
|||
listener.onResult(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
listener.onFailure(exp);
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
|
|||
listener.onResult(response.queryResult());
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
listener.onFailure(exp);
|
||||
}
|
||||
|
||||
|
@ -234,7 +234,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
|
|||
listener.onResult(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
listener.onFailure(exp);
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
|
|||
listener.onResult(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
listener.onFailure(exp);
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
|
|||
listener.onResult(response.result());
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
listener.onFailure(exp);
|
||||
}
|
||||
|
||||
|
@ -324,7 +324,7 @@ public class SearchServiceTransportAction extends AbstractComponent {
|
|||
listener.onResult(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
listener.onFailure(exp);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* Licensed to Elastic Search and Shay Banon under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. Elastic Search 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.elasticsearch.transport;
|
||||
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
|
||||
/**
|
||||
* An action invocation failure.
|
||||
*
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public class ActionTransportException extends TransportException {
|
||||
|
||||
private TransportAddress address;
|
||||
|
||||
private String action;
|
||||
|
||||
public ActionTransportException(String msg, Throwable cause) {
|
||||
super(msg, cause);
|
||||
}
|
||||
|
||||
public ActionTransportException(String name, TransportAddress address, String action, Throwable cause) {
|
||||
super(buildMessage(name, address, action), cause);
|
||||
this.address = address;
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
/**
|
||||
* The target address to invoke the action on.
|
||||
*/
|
||||
public TransportAddress address() {
|
||||
return address;
|
||||
}
|
||||
|
||||
/**
|
||||
* The action to invoke.
|
||||
*/
|
||||
public String action() {
|
||||
return action;
|
||||
}
|
||||
|
||||
private static String buildMessage(String name, TransportAddress address, String action) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (name != null) {
|
||||
sb.append('[').append(name).append(']');
|
||||
}
|
||||
if (address != null) {
|
||||
sb.append('[').append(address).append(']');
|
||||
}
|
||||
if (action != null) {
|
||||
sb.append('[').append(action).append(']');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
|
@ -24,7 +24,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
|
|||
/**
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public class ConnectTransportException extends RemoteTransportException {
|
||||
public class ConnectTransportException extends ActionTransportException {
|
||||
|
||||
private final DiscoveryNode node;
|
||||
|
||||
|
|
|
@ -31,6 +31,6 @@ public abstract class FutureTransportResponseHandler<T extends Streamable> exten
|
|||
@Override public void handleResponse(T response) {
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,9 @@ public class NodeDisconnectedException extends ConnectTransportException {
|
|||
super(node, "disconnected", action, null);
|
||||
}
|
||||
|
||||
// @Override public Throwable fillInStackTrace() {
|
||||
// return fillStack();
|
||||
// }
|
||||
// stack trace is meaningless...
|
||||
|
||||
@Override public Throwable fillInStackTrace() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -79,7 +79,7 @@ public class PlainTransportFuture<V extends Streamable> extends AbstractFuture<V
|
|||
set(response);
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
handler.handleException(exp);
|
||||
setException(exp);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
|
|||
/**
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public class ReceiveTimeoutTransportException extends RemoteTransportException {
|
||||
public class ReceiveTimeoutTransportException extends ActionTransportException {
|
||||
|
||||
public ReceiveTimeoutTransportException(DiscoveryNode node, String action) {
|
||||
super(node.name(), node.address(), action, null);
|
||||
|
|
|
@ -23,52 +23,23 @@ import org.elasticsearch.ElasticSearchWrapperException;
|
|||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
|
||||
/**
|
||||
* A remote exception for an action. A wrapper exception around the actual remote cause and does not fill the
|
||||
* stack trace.
|
||||
*
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public class RemoteTransportException extends TransportException implements ElasticSearchWrapperException {
|
||||
|
||||
private TransportAddress address;
|
||||
|
||||
private String action;
|
||||
public class RemoteTransportException extends ActionTransportException implements ElasticSearchWrapperException {
|
||||
|
||||
public RemoteTransportException(String msg, Throwable cause) {
|
||||
super(msg, cause);
|
||||
}
|
||||
|
||||
public RemoteTransportException(String name, TransportAddress address, String action, Throwable cause) {
|
||||
super(buildMessage(name, address, action), cause);
|
||||
this.address = address;
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public TransportAddress address() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public String action() {
|
||||
return action;
|
||||
super(name, address, action, cause);
|
||||
}
|
||||
|
||||
@Override public Throwable fillInStackTrace() {
|
||||
// no need for stack trace here, we always have cause
|
||||
return null;
|
||||
}
|
||||
|
||||
protected Throwable fillStack() {
|
||||
return super.fillInStackTrace();
|
||||
}
|
||||
|
||||
private static String buildMessage(String name, TransportAddress address, String action) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (name != null) {
|
||||
sb.append('[').append(name).append(']');
|
||||
}
|
||||
if (address != null) {
|
||||
sb.append('[').append(address).append(']');
|
||||
}
|
||||
if (action != null) {
|
||||
sb.append('[').append(action).append(']');
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,11 +20,17 @@
|
|||
package org.elasticsearch.transport;
|
||||
|
||||
/**
|
||||
* A failure to handle the response of a transaction action.
|
||||
*
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public class ResponseHandlerFailureTransportException extends RemoteTransportException {
|
||||
public class ResponseHandlerFailureTransportException extends TransportException {
|
||||
|
||||
public ResponseHandlerFailureTransportException(Throwable cause) {
|
||||
super(cause.getMessage(), cause);
|
||||
}
|
||||
|
||||
@Override public Throwable fillInStackTrace() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,13 +24,9 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
|
|||
/**
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public class SendRequestTransportException extends RemoteTransportException {
|
||||
public class SendRequestTransportException extends ActionTransportException {
|
||||
|
||||
public SendRequestTransportException(DiscoveryNode node, String action, Throwable cause) {
|
||||
super(node == null ? null : node.name(), node == null ? null : node.address(), action, cause);
|
||||
}
|
||||
|
||||
@Override public Throwable fillInStackTrace() {
|
||||
return super.fillStack();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public interface TransportResponseHandler<T extends Streamable> {
|
|||
|
||||
void handleResponse(T response);
|
||||
|
||||
void handleException(RemoteTransportException exp);
|
||||
void handleException(TransportException exp);
|
||||
|
||||
boolean spawn();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.elasticsearch.transport;
|
|||
import org.elasticsearch.common.io.stream.VoidStreamable;
|
||||
|
||||
/**
|
||||
* @author kimchy (Shay Banon)
|
||||
* @author kimchy (shay.banon)
|
||||
*/
|
||||
public class VoidTransportResponseHandler implements TransportResponseHandler<VoidStreamable> {
|
||||
|
||||
|
@ -46,7 +46,7 @@ public class VoidTransportResponseHandler implements TransportResponseHandler<Vo
|
|||
@Override public void handleResponse(VoidStreamable response) {
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
}
|
||||
|
||||
@Override public boolean spawn() {
|
||||
|
|
|
@ -98,7 +98,7 @@ public abstract class AbstractSimpleTransportTests {
|
|||
assertThat("hello moshe", equalTo(response.message));
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
exp.printStackTrace();
|
||||
assertThat("got exception instead of a response: " + exp.getMessage(), false, equalTo(true));
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ public abstract class AbstractSimpleTransportTests {
|
|||
assertThat("hello moshe", equalTo(response.message));
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
exp.printStackTrace();
|
||||
assertThat("got exception instead of a response: " + exp.getMessage(), false, equalTo(true));
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ public abstract class AbstractSimpleTransportTests {
|
|||
assertThat("got response instead of exception", false, equalTo(true));
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
assertThat("bad message !!!", equalTo(exp.getCause().getMessage()));
|
||||
}
|
||||
});
|
||||
|
@ -251,7 +251,7 @@ public abstract class AbstractSimpleTransportTests {
|
|||
assertThat("got response instead of exception", false, equalTo(true));
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
assertThat(exp, instanceOf(ReceiveTimeoutTransportException.class));
|
||||
}
|
||||
});
|
||||
|
@ -301,7 +301,7 @@ public abstract class AbstractSimpleTransportTests {
|
|||
assertThat("got response instead of exception", false, equalTo(true));
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
assertThat(exp, instanceOf(ReceiveTimeoutTransportException.class));
|
||||
}
|
||||
});
|
||||
|
@ -330,7 +330,7 @@ public abstract class AbstractSimpleTransportTests {
|
|||
assertThat("hello " + counter + "ms", equalTo(response.message));
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
exp.printStackTrace();
|
||||
assertThat("got exception instead of a response for " + counter + ": " + exp.getDetailedMessage(), false, equalTo(true));
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
import org.elasticsearch.threadpool.cached.CachedThreadPool;
|
||||
import org.elasticsearch.timer.TimerService;
|
||||
import org.elasticsearch.transport.BaseTransportResponseHandler;
|
||||
import org.elasticsearch.transport.RemoteTransportException;
|
||||
import org.elasticsearch.transport.TransportException;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.transport.netty.NettyTransport;
|
||||
|
||||
|
@ -76,7 +76,7 @@ public class BenchmarkNettyClient {
|
|||
@Override public void handleResponse(BenchmarkMessage response) {
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
exp.printStackTrace();
|
||||
}
|
||||
}).txGet();
|
||||
|
@ -103,7 +103,7 @@ public class BenchmarkNettyClient {
|
|||
latch.countDown();
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
exp.printStackTrace();
|
||||
latch.countDown();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.elasticsearch.threadpool.ThreadPool;
|
|||
import org.elasticsearch.threadpool.cached.CachedThreadPool;
|
||||
import org.elasticsearch.timer.TimerService;
|
||||
import org.elasticsearch.transport.BaseTransportResponseHandler;
|
||||
import org.elasticsearch.transport.RemoteTransportException;
|
||||
import org.elasticsearch.transport.TransportException;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.transport.netty.NettyTransport;
|
||||
|
||||
|
@ -115,7 +115,7 @@ public class BenchmarkNettyClientBlocking {
|
|||
@Override public void handleResponse(BenchmarkMessage response) {
|
||||
}
|
||||
|
||||
@Override public void handleException(RemoteTransportException exp) {
|
||||
@Override public void handleException(TransportException exp) {
|
||||
exp.printStackTrace();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue