Github user olegz commented on a diff in the pull request:
https://github.com/apache/nifi/pull/840#discussion_r74787227
--- 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) {
--- End diff --
Also, catching Throwable is very dangerous. We are essentially including
Errors in the mix such as OOM etc, and by doing so proclaiming that we can
actually do something about it when in reality we simply can't. Those are
generally unrecoverable
---
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.
---