close open index input on failure

This commit is contained in:
kimchy 2010-06-27 02:13:59 +03:00
parent 33d357dbb4
commit edd8786a81
1 changed files with 6 additions and 0 deletions

View File

@ -537,6 +537,7 @@ public abstract class BlobStoreIndexShardGateway extends AbstractIndexShardCompo
indexOutput.close();
} catch (IOException e) {
onFailure(e);
return;
}
}
recoveryThrottler.streamDone(shardId, fileToRecover);
@ -595,6 +596,11 @@ public abstract class BlobStoreIndexShardGateway extends AbstractIndexShardCompo
}
@Override public void onFailure(Throwable t) {
try {
fIndexInput.close();
} catch (IOException e) {
// ignore
}
failures.add(t);
if (counter.decrementAndGet() == 0) {
latch.countDown();