Handle all available references in the DataStore when doing consistency check
close (another) FileReader when done
@@ -720,10 +720,11 @@ public class MarkSweepGarbageCollector implements BlobGarbageCollector {
LOG.info("Consistency check found [{}] missing blobs", candidates);
if (candidates > 0) {
- LineIterator lineIterator = new LineIterator(new FileReader(fs.getGcCandidates()));
+ try (LineIterator lineIterator = new LineIterator(new FileReader(fs.getGcCandidates()))) {
while(lineIterator.hasNext()) {
LOG.warn("Missing Blob [{}]", lineIterator.nextLine());
}
+ }
LOG.warn("Consistency check failure in the the blob store : {}, check missing candidates in file {}",
blobStore, fs.getGcCandidates().getAbsolutePath());
consistencyStatsCollector.finishFailure();
