create a send transaction exception on the calling thread and fill its stack, so we know where its coming from

This commit is contained in:
kimchy 2010-07-20 18:33:44 +03:00
parent 07480846c3
commit 553e8134ee
3 changed files with 4 additions and 2 deletions

View File

@ -23,7 +23,7 @@ import org.elasticsearch.ElasticSearchWrapperException;
import org.elasticsearch.common.transport.TransportAddress;
/**
* @author kimchy (Shay Banon)
* @author kimchy (shay.banon)
*/
public class RemoteTransportException extends TransportException implements ElasticSearchWrapperException {

View File

@ -28,5 +28,6 @@ public class SendRequestTransportException extends RemoteTransportException {
public SendRequestTransportException(DiscoveryNode node, String action, Throwable cause) {
super(node == null ? null : node.name(), node == null ? null : node.address(), action, cause);
fillStack();
}
}

View File

@ -195,9 +195,10 @@ public class TransportService extends AbstractLifecycleComponent<TransportServic
}
// callback that an exception happened, but on a different thread since we don't
// want handlers to worry about stack overflows
final SendRequestTransportException sendRequestException = new SendRequestTransportException(node, action, e);
threadPool.execute(new Runnable() {
@Override public void run() {
handler.handleException(new SendRequestTransportException(node, action, e));
handler.handleException(sendRequestException);
}
});
}