Github user olegz commented on a diff in the pull request:
https://github.com/apache/nifi/pull/840#discussion_r74783931
--- Diff:
nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/PersistentProvenanceRepository.java
---
@@ -1302,27 +1301,35 @@ public void run() {
}
logger.info("Successfully Rolled over
Provenance Event file containing {} records", recordsWritten);
+ }
+
+ //if files were rolled over or if out of retries
stop the future
+ if(fileRolledOver != null ||
retryAttempts.decrementAndGet() == 0) {
+
+ if(fileRolledOver== null &&
retryAttempts.get() == 0){
+ logger.error("Failed to merge Journal
Files {} after {} attempts. ",journalsToMerge, MAX_JOURNAL_ROLLOVER_RETRIES);
+ }
+
rolloverCompletions.getAndIncrement();
- // We have finished successfully. Cancel the
future so that we don't run anymore
+ // Cancel the future so that we don't run
anymore
Future<?> future;
while ((future = futureReference.get()) ==
null) {
try {
Thread.sleep(10L);
} catch (final InterruptedException ie) {
--- End diff --
I know this is not your code, but we need to reset the interrupt flag on
the thread.
```
Thread.currentThread().interrupt();
```
otherwise it could lead to unresponsive system
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---