Github user joewitt commented on a diff in the pull request: https://github.com/apache/nifi/pull/430#discussion_r63239617 --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/repository/StandardProcessSession.java --- @@ -909,13 +922,27 @@ private void rollback(final boolean penalize, final boolean rollbackCheckpoint) if (record.getOriginal() != null) { final FlowFileQueue originalQueue = record.getOriginalQueue(); if (originalQueue != null) { + FlowFileRecord fileRecord; if (penalize) { final long expirationEpochMillis = System.currentTimeMillis() + context.getConnectable().getPenalizationPeriod(TimeUnit.MILLISECONDS); - final FlowFileRecord newFile = new StandardFlowFileRecord.Builder().fromFlowFile(record.getOriginal()).penaltyExpirationTime(expirationEpochMillis).build(); - originalQueue.put(newFile); + fileRecord = new StandardFlowFileRecord.Builder().fromFlowFile(record.getOriginal()).penaltyExpirationTime(expirationEpochMillis).build(); } else { - originalQueue.put(record.getOriginal()); + fileRecord = record.getOriginal(); } + final Map<String, String> attributes = new HashMap<>(); + if (this.isRollbackCountEnabled) { + try { + Long rollbackCount = 0L; + if (record.getCurrent().getAttributes().containsKey(ROLLBACK_COUNT_ATTR_NAME)) { + rollbackCount = Long.parseLong(record.getOriginalAttributes().get(ROLLBACK_COUNT_ATTR_NAME)); --- End diff -- Very important to always avoid using Long or Int parsing to determine if something is Long or Int in core high-rate framework code sections. Exception handling for flow control in such cases can be an absolute performance killer.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---