lazily create the no shard available exception

This commit is contained in:
Shay Banon 2013-08-13 16:41:16 +02:00
parent acf17b4e39
commit e111a7da62
1 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ public abstract class TransportShardSingleOperationAction<Request extends Single
} }
public void start() { public void start() {
perform(new NoShardAvailableActionException(shardIt.shardId())); perform(null);
} }
private void onFailure(ShardRouting shardRouting, Throwable e) { private void onFailure(ShardRouting shardRouting, Throwable e) {
@ -140,7 +140,7 @@ public abstract class TransportShardSingleOperationAction<Request extends Single
if (shardRouting == null) { if (shardRouting == null) {
Throwable failure = lastFailure; Throwable failure = lastFailure;
if (failure == null) { if (failure == null) {
failure = new NoShardAvailableActionException(shardIt.shardId(), "No shard available for [" + request + "]"); failure = new NoShardAvailableActionException(shardIt.shardId());
} else { } else {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("{}: failed to execute [{}]", failure, shardIt.shardId(), request); logger.debug("{}: failed to execute [{}]", failure, shardIt.shardId(), request);