Catch Throwable when listener is called rather then Exception to prevent possible hangs if fatal exceptions or errors are thrown
This commit is contained in:
parent
a206aa4548
commit
f1dd867c4f
|
@ -274,7 +274,7 @@ public class TransportBulkAction extends TransportAction<BulkRequest, BulkRespon
|
|||
public void onResponse(BulkResponse result) {
|
||||
try {
|
||||
channel.sendResponse(result);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ public class TransportMultiGetAction extends TransportAction<MultiGetRequest, Mu
|
|||
public void onResponse(MultiGetResponse response) {
|
||||
try {
|
||||
channel.sendResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public class TransportIndexAction extends TransportShardReplicationOperationActi
|
|||
// we have the index, do it
|
||||
try {
|
||||
innerExecute(request, listener);
|
||||
} catch (Exception e1) {
|
||||
} catch (Throwable e1) {
|
||||
listener.onFailure(e1);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -182,7 +182,7 @@ public class TransportMoreLikeThisAction extends TransportAction<MoreLikeThisReq
|
|||
// exclude myself
|
||||
Term uidTerm = docMapper.uidMapper().term(request.type(), request.id());
|
||||
boolBuilder.mustNot(termQuery(uidTerm.field(), uidTerm.text()));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return;
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ public class TransportMoreLikeThisAction extends TransportAction<MoreLikeThisReq
|
|||
public void onResponse(SearchResponse result) {
|
||||
try {
|
||||
channel.sendResponse(result);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public class TransportMultiSearchAction extends TransportAction<MultiSearchReque
|
|||
public void onResponse(MultiSearchResponse response) {
|
||||
try {
|
||||
channel.sendResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ public class TransportSearchAction extends TransportAction<SearchRequest, Search
|
|||
public void onResponse(SearchResponse result) {
|
||||
try {
|
||||
channel.sendResponse(result);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public class TransportSearchScrollAction extends TransportAction<SearchScrollReq
|
|||
} else {
|
||||
throw new ElasticSearchIllegalArgumentException("Scroll id type [" + scrollId.getType() + "] unrecognized");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class TransportSearchScrollAction extends TransportAction<SearchScrollReq
|
|||
public void onResponse(SearchResponse result) {
|
||||
try {
|
||||
channel.sendResponse(result);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ public class TransportSearchDfsQueryThenFetchAction extends TransportSearchTypeA
|
|||
void executeFetchPhase() {
|
||||
try {
|
||||
innerExecuteFetchPhase();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(new ReduceSearchPhaseException("query", "", e, buildShardFailures()));
|
||||
}
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ public class TransportSearchDfsQueryThenFetchAction extends TransportSearchTypeA
|
|||
void finishHim() {
|
||||
try {
|
||||
innerFinishHim();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
ReduceSearchPhaseException failure = new ReduceSearchPhaseException("fetch", "", e, buildShardFailures());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("failed to reduce search", failure);
|
||||
|
|
|
@ -222,7 +222,7 @@ public class TransportSearchScrollQueryAndFetchAction extends AbstractComponent
|
|||
private void finishHim() {
|
||||
try {
|
||||
innerFinishHim();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(new ReduceSearchPhaseException("fetch", "", e, buildShardFailures()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -253,7 +253,7 @@ public class TransportSearchScrollQueryThenFetchAction extends AbstractComponent
|
|||
private void finishHim() {
|
||||
try {
|
||||
innerFinishHim();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(new ReduceSearchPhaseException("fetch", "", e, buildShardFailures()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,7 +227,7 @@ public abstract class TransportSearchTypeAction extends TransportAction<SearchRe
|
|||
if (xTotalOps == expectedTotalOps) {
|
||||
try {
|
||||
moveToSecondPhase();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(shardIt.shardId() + ": Failed to execute [" + request + "] while moving to second phase", e);
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ public abstract class TransportSearchTypeAction extends TransportAction<SearchRe
|
|||
} else {
|
||||
try {
|
||||
moveToSecondPhase();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(new ReduceSearchPhaseException(firstPhaseName(), "", e, buildShardFailures()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public abstract class TransportAction<Request extends ActionRequest, Response ex
|
|||
}
|
||||
try {
|
||||
doExecute(request, listener);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
logger.trace("Error during transport action execution.", e);
|
||||
listener.onFailure(e);
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public abstract class TransportAction<Request extends ActionRequest, Response ex
|
|||
public void run() {
|
||||
try {
|
||||
listener.onResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -395,7 +395,7 @@ public abstract class TransportBroadcastOperationAction<Request extends Broadcas
|
|||
public void onResponse(Response response) {
|
||||
try {
|
||||
channel.sendResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ public abstract class TransportMasterNodeOperationAction<Request extends MasterN
|
|||
try {
|
||||
Response response = masterOperation(request, clusterState);
|
||||
listener.onResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ public abstract class TransportMasterNodeOperationAction<Request extends MasterN
|
|||
public void onResponse(Response response) {
|
||||
try {
|
||||
channel.sendResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ public abstract class TransportNodesOperationAction<Request extends NodesOperati
|
|||
public void run() {
|
||||
try {
|
||||
onOperation(nodeOperation(newNodeRequest(clusterState.nodes().localNodeId(), request)));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(clusterState.nodes().localNodeId(), e);
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public abstract class TransportNodesOperationAction<Request extends NodesOperati
|
|||
public void run() {
|
||||
try {
|
||||
onOperation(nodeOperation(newNodeRequest(clusterState.nodes().masterNodeId(), request)));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(clusterState.nodes().masterNodeId(), e);
|
||||
}
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ public abstract class TransportNodesOperationAction<Request extends NodesOperati
|
|||
TransportResponseOptions options = TransportResponseOptions.options().withCompress(transportCompress());
|
||||
try {
|
||||
channel.sendResponse(response, options);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public abstract class TransportIndexReplicationOperationAction<Request extends I
|
|||
GroupShardsIterator groups;
|
||||
try {
|
||||
groups = shards(request);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ public abstract class TransportIndexReplicationOperationAction<Request extends I
|
|||
public void onResponse(Response result) {
|
||||
try {
|
||||
channel.sendResponse(result);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ public abstract class TransportIndicesReplicationOperationAction<Request extends
|
|||
public void onResponse(Response result) {
|
||||
try {
|
||||
channel.sendResponse(result);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
|||
public void onResponse(Response result) {
|
||||
try {
|
||||
channel.sendResponse(result);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
|||
}
|
||||
}
|
||||
shardIt = shards(clusterState, request);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ public abstract class TransportSingleCustomOperationAction<Request extends Singl
|
|||
performFirst();
|
||||
}
|
||||
|
||||
private void onFailure(ShardRouting shardRouting, Exception e) {
|
||||
private void onFailure(ShardRouting shardRouting, Throwable e) {
|
||||
if (logger.isTraceEnabled() && e != null) {
|
||||
logger.trace(shardRouting.shortSummary() + ": Failed to execute [" + request + "]", e);
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ public abstract class TransportSingleCustomOperationAction<Request extends Singl
|
|||
try {
|
||||
Response response = shardOperation(request, -1);
|
||||
listener.onResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(null, e);
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ public abstract class TransportSingleCustomOperationAction<Request extends Singl
|
|||
final Response response = shardOperation(request, -1);
|
||||
listener.onResponse(response);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(null, e);
|
||||
}
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ public abstract class TransportSingleCustomOperationAction<Request extends Singl
|
|||
try {
|
||||
Response response = shardOperation(request, shard.id());
|
||||
listener.onResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
shardsIt.reset();
|
||||
onFailure(shard, e);
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ public abstract class TransportSingleCustomOperationAction<Request extends Singl
|
|||
final Response response = shardOperation(request, shard.id());
|
||||
listener.onResponse(response);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
shardsIt.reset();
|
||||
onFailure(shard, e);
|
||||
}
|
||||
|
@ -203,10 +203,10 @@ public abstract class TransportSingleCustomOperationAction<Request extends Singl
|
|||
}
|
||||
}
|
||||
|
||||
private void perform(final Exception lastException) {
|
||||
private void perform(final Throwable lastException) {
|
||||
final ShardRouting shard = shardsIt == null ? null : shardsIt.nextOrNull();
|
||||
if (shard == null) {
|
||||
Exception failure = lastException;
|
||||
Throwable failure = lastException;
|
||||
if (failure == null) {
|
||||
failure = new NoShardAvailableActionException(null, "No shard available for [" + request + "]");
|
||||
} else {
|
||||
|
@ -227,7 +227,7 @@ public abstract class TransportSingleCustomOperationAction<Request extends Singl
|
|||
try {
|
||||
Response response = shardOperation(request, shard.id());
|
||||
listener.onResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(shard, e);
|
||||
}
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ public abstract class TransportSingleCustomOperationAction<Request extends Singl
|
|||
try {
|
||||
final Response response = shardOperation(request, shard.id());
|
||||
listener.onResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(shard, e);
|
||||
}
|
||||
}
|
||||
|
@ -289,7 +289,7 @@ public abstract class TransportSingleCustomOperationAction<Request extends Singl
|
|||
public void onResponse(Response result) {
|
||||
try {
|
||||
channel.sendResponse(result);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ public abstract class TransportInstanceSingleOperationAction<Request extends Ins
|
|||
}
|
||||
}
|
||||
shardIt = shards(clusterState, request);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return true;
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ public abstract class TransportInstanceSingleOperationAction<Request extends Ins
|
|||
public void onResponse(Response result) {
|
||||
try {
|
||||
channel.sendResponse(result);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,17 +124,17 @@ public abstract class TransportShardSingleOperationAction<Request extends Single
|
|||
perform(null);
|
||||
}
|
||||
|
||||
private void onFailure(ShardRouting shardRouting, Exception e) {
|
||||
private void onFailure(ShardRouting shardRouting, Throwable e) {
|
||||
if (logger.isTraceEnabled() && e != null) {
|
||||
logger.trace("{}: failed to execute [{}]", e, shardRouting, request);
|
||||
}
|
||||
perform(e);
|
||||
}
|
||||
|
||||
private void perform(@Nullable final Exception lastException) {
|
||||
private void perform(@Nullable final Throwable lastException) {
|
||||
final ShardRouting shardRouting = shardIt.nextOrNull();
|
||||
if (shardRouting == null) {
|
||||
Exception failure = lastException;
|
||||
Throwable failure = lastException;
|
||||
if (failure == null) {
|
||||
failure = new NoShardAvailableActionException(shardIt.shardId(), "No shard available for [" + request + "]");
|
||||
} else {
|
||||
|
@ -155,7 +155,7 @@ public abstract class TransportShardSingleOperationAction<Request extends Single
|
|||
try {
|
||||
Response response = shardOperation(request, shardRouting.id());
|
||||
listener.onResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(shardRouting, e);
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ public abstract class TransportShardSingleOperationAction<Request extends Single
|
|||
try {
|
||||
final Response response = shardOperation(request, shardRouting.id());
|
||||
listener.onResponse(response);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(shardRouting, e);
|
||||
}
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ public abstract class TransportShardSingleOperationAction<Request extends Single
|
|||
public void onResponse(Response result) {
|
||||
try {
|
||||
channel.sendResponse(result);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ public class TransportUpdateAction extends TransportInstanceSingleOperationActio
|
|||
// we have the index, do it
|
||||
try {
|
||||
innerExecute(request, listener);
|
||||
} catch (Exception e1) {
|
||||
} catch (Throwable e1) {
|
||||
listener.onFailure(e1);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -247,7 +247,7 @@ public class TransportClientNodesService extends AbstractComponent {
|
|||
} else {
|
||||
try {
|
||||
callback.doWithNode(nodes.get((index + i) % nodes.size()), this);
|
||||
} catch (Exception e1) {
|
||||
} catch (Throwable e1) {
|
||||
// retry the next one...
|
||||
onFailure(e);
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ public class MetaDataCreateIndexService extends AbstractComponent {
|
|||
try {
|
||||
try {
|
||||
validate(request, currentState);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return currentState;
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ public class MetaDataDeleteIndexService extends AbstractComponent {
|
|||
});
|
||||
|
||||
return newClusterStateBuilder().state(currentState).routingResult(routingResult).metaData(newMetaData).blocks(blocks).build();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return currentState;
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ public class MetaDataIndexAliasesService extends AbstractComponent {
|
|||
} finally {
|
||||
parser.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(new ElasticSearchIllegalArgumentException("failed to parse filter for [" + aliasAction.alias() + "]", e));
|
||||
return currentState;
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ public class MetaDataIndexTemplateService extends AbstractComponent {
|
|||
|
||||
try {
|
||||
validate(request);
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public class MetaDataIndexTemplateService extends AbstractComponent {
|
|||
for (Map.Entry<String, IndexMetaData.Custom> entry : request.customs.entrySet()) {
|
||||
templateBuilder.putCustom(entry.getKey(), entry.getValue());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ public class MetaDataMappingService extends AbstractComponent {
|
|||
MetaData.Builder builder = newMetaDataBuilder().metaData(currentState.metaData());
|
||||
builder.put(newIndexMetaDataBuilder(indexMetaData).putMapping(new MappingMetaData(updatedMapper)));
|
||||
return newClusterStateBuilder().state(currentState).metaData(builder).build();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
logger.warn("failed to dynamically update the mapping in cluster_state from shard", e);
|
||||
listener.onFailure(e);
|
||||
return currentState;
|
||||
|
@ -256,7 +256,7 @@ public class MetaDataMappingService extends AbstractComponent {
|
|||
|
||||
notifyOnPostProcess.set(true);
|
||||
return ClusterState.builder().state(currentState).metaData(builder).build();
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return currentState;
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ public class MetaDataMappingService extends AbstractComponent {
|
|||
}
|
||||
mappingCreatedAction.add(new CountDownListener(counter, listener), request.timeout);
|
||||
return updatedState;
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return currentState;
|
||||
} finally {
|
||||
|
|
|
@ -265,7 +265,7 @@ public class MetaDataUpdateSettingsService extends AbstractComponent implements
|
|||
updatedState = newClusterStateBuilder().state(updatedState).routingResult(routingResult).build();
|
||||
|
||||
return updatedState;
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
listener.onFailure(e);
|
||||
return currentState;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.apache.lucene.util.LongsRef;
|
|||
|
||||
import com.google.common.primitives.Longs;
|
||||
|
||||
public class SlicedLongList extends AbstractList<Long> implements RandomAccess {
|
||||
public final class SlicedLongList extends AbstractList<Long> implements RandomAccess {
|
||||
|
||||
public static final SlicedLongList EMPTY = new SlicedLongList(LongsRef.EMPTY_LONGS, 0, 0);
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ public class RestClusterHealthAction extends BaseRestHandler {
|
|||
builder.endObject();
|
||||
|
||||
channel.sendResponse(new XContentRestResponse(request, status, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class RestNodesHotThreadsAction extends BaseRestHandler {
|
|||
sb.append('\n');
|
||||
}
|
||||
channel.sendResponse(new StringRestResponse(RestStatus.OK, sb.toString()));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ public class RestNodesInfoAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, RestStatus.OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class RestNodesRestartAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, RestStatus.OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public class RestNodesShutdownAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, RestStatus.OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ public class RestNodesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, RestStatus.OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class RestClusterRerouteAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, RestStatus.OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ public class RestClusterGetSettingsAction extends BaseRestHandler {
|
|||
builder.endObject();
|
||||
|
||||
channel.sendResponse(new XContentRestResponse(request, RestStatus.OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class RestClusterUpdateSettingsAction extends BaseRestHandler {
|
|||
public void onResponse(ClusterUpdateSettingsResponse response) {
|
||||
try {
|
||||
channel.sendResponse(new StringRestResponse(RestStatus.OK));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public class RestClusterSearchShardsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, RestStatus.OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ public class RestClusterStateAction extends BaseRestHandler {
|
|||
response.getState().settingsFilter(settingsFilter).toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, RestStatus.OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public class RestGetIndicesAliasesAction extends BaseRestHandler {
|
|||
builder.endObject();
|
||||
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ public class RestIndicesAliasesAction extends BaseRestHandler {
|
|||
.field("acknowledged", response.isAcknowledged())
|
||||
.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class RestAnalyzeAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ public class RestClearIndicesCacheAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public class RestCreateIndexAction extends BaseRestHandler {
|
|||
.field("acknowledged", response.isAcknowledged())
|
||||
.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class RestIndicesExistsAction extends BaseRestHandler {
|
|||
} else {
|
||||
channel.sendResponse(new StringRestResponse(NOT_FOUND));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public class RestTypesExistsAction extends BaseRestHandler {
|
|||
} else {
|
||||
channel.sendResponse(new StringRestResponse(NOT_FOUND));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class RestFlushAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public class RestGatewaySnapshotAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ public class RestGetMappingAction extends BaseRestHandler {
|
|||
builder.endObject();
|
||||
|
||||
channel.sendResponse(new XContentRestResponse(request, foundAny || indices.length == 0 ? OK : NOT_FOUND, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ public class RestOptimizeAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public class RestRefreshAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public class RestIndicesSegmentsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public class RestGetSettingsAction extends BaseRestHandler {
|
|||
builder.endObject();
|
||||
|
||||
channel.sendResponse(new XContentRestResponse(request, foundAny ? OK : NOT_FOUND, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public class RestUpdateSettingsAction extends BaseRestHandler {
|
|||
.field("ok", true)
|
||||
.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -239,7 +239,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -434,7 +434,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public class RestIndicesStatusAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request, settingsFilter);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ public class RestGetIndexTemplateAction extends BaseRestHandler {
|
|||
builder.endObject();
|
||||
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ public class RestValidateQueryAction extends BaseRestHandler {
|
|||
}
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ public class RestGetWarmerAction extends BaseRestHandler {
|
|||
}
|
||||
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ public class RestBulkAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ public class RestCountAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ public class RestDeleteAction extends BaseRestHandler {
|
|||
status = NOT_FOUND;
|
||||
}
|
||||
channel.sendResponse(new XContentRestResponse(request, status, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ public class RestDeleteByQueryAction extends BaseRestHandler {
|
|||
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ public class RestExplainAction extends BaseRestHandler {
|
|||
}
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, response.isExists() ? OK : NOT_FOUND, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public class RestGetAction extends BaseRestHandler {
|
|||
} else {
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public class RestHeadAction extends BaseRestHandler {
|
|||
} else {
|
||||
channel.sendResponse(new StringRestResponse(OK));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ public class RestMultiGetAction extends BaseRestHandler {
|
|||
XContentBuilder builder = restContentBuilder(request);
|
||||
response.toXContent(builder, request);
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ public class RestIndexAction extends BaseRestHandler {
|
|||
status = CREATED;
|
||||
}
|
||||
channel.sendResponse(new XContentRestResponse(request, status, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public class RestMainAction extends BaseRestHandler {
|
|||
builder.field("tagline", "You Know, for Search");
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, status, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ public class RestMoreLikeThisAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ public class RestPercolateAction extends BaseRestHandler {
|
|||
builder.endObject();
|
||||
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ public class RestMultiSearchAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ public class RestSearchScrollAction extends BaseRestHandler {
|
|||
response.toXContent(builder, request);
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, response.status(), builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ public class RestSuggestAction extends BaseRestHandler {
|
|||
}
|
||||
builder.endObject();
|
||||
channel.sendResponse(new XContentRestResponse(request, OK, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ public class RestUpdateAction extends BaseRestHandler {
|
|||
status = CREATED;
|
||||
}
|
||||
channel.sendResponse(new XContentRestResponse(request, status, builder));
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
onFailure(e);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue