Skip to content

Commit

Permalink
Handle IndexShard.getLatestReplicationCheckpoint for closed indices (o…
Browse files Browse the repository at this point in the history
…pensearch-project#7056)

Signed-off-by: Poojita Raj <poojiraj@amazon.com>
  • Loading branch information
Poojita-Raj authored and austintlee committed Apr 28, 2023
1 parent 5181380 commit 9608c18
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2145,7 +2145,13 @@ public GatedCloseable<SegmentInfos> getSegmentInfosSnapshot() {
} catch (IOException e) {
throw new EngineException(shardId, e.getMessage(), e);
}
return new GatedCloseable<>(segmentInfos, () -> indexWriter.decRefDeleter(segmentInfos));
return new GatedCloseable<>(segmentInfos, () -> {
try {
indexWriter.decRefDeleter(segmentInfos);
} catch (AlreadyClosedException e) {
logger.warn("Engine is already closed.", e);
}
});
}

@Override
Expand Down

0 comments on commit 9608c18

Please sign in to comment.