Always catch exceptions from TransportBroadcastOperationAction#newResponse (reduce phase)

This commit is contained in:
Martijn van Groningen 2013-08-15 13:15:52 +02:00
parent 174707061c
commit bfac2f575e
1 changed files with 10 additions and 2 deletions

View File

@ -142,7 +142,11 @@ public abstract class TransportBroadcastOperationAction<Request extends Broadcas
public void start() {
if (shardsIts.size() == 0) {
// no shards
listener.onResponse(newResponse(request, new AtomicReferenceArray(0), clusterState));
try {
listener.onResponse(newResponse(request, new AtomicReferenceArray(0), clusterState));
} catch (Throwable e) {
listener.onFailure(e);
}
}
request.beforeStart();
// count the local operations, and perform the non local ones
@ -313,7 +317,11 @@ public abstract class TransportBroadcastOperationAction<Request extends Broadcas
}
void finishHim() {
listener.onResponse(newResponse(request, shardsResponses, clusterState));
try {
listener.onResponse(newResponse(request, shardsResponses, clusterState));
} catch (Throwable e) {
listener.onFailure(e);
}
}
void setFailure(ShardIterator shardIt, int shardIndex, Throwable t) {