mirror of https://github.com/apache/nifi.git
NIFI-3152: Ensure that we always close the IndexWriter when appropriate in SimpleIndexManager, even if an IOException is thrown when trying to commit the IndexWriter
This closes #1300. Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
parent
7633fe35c1
commit
fc0d336f36
|
@ -158,8 +158,11 @@ public class SimpleIndexManager implements IndexManager {
|
|||
} else if (count.getCount() <= 1) {
|
||||
// we are finished with this writer.
|
||||
logger.debug("Decrementing count for Index Writer for {} to {}; Closing writer", indexingDirectory, count.getCount() - 1);
|
||||
try {
|
||||
writer.commit();
|
||||
} finally {
|
||||
count.close();
|
||||
}
|
||||
} else {
|
||||
// decrement the count.
|
||||
logger.debug("Decrementing count for Index Writer for {} to {}", indexingDirectory, count.getCount() - 1);
|
||||
|
|
Loading…
Reference in New Issue