markap14 commented on a change in pull request #5042:
URL: https://github.com/apache/nifi/pull/5042#discussion_r625968516



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ConnectableTask.java
##########
@@ -260,18 +260,10 @@ public InvocationResult invoke() {
         } finally {
             try {
                 if (batch) {
-                    try {
-                        rawSession.commit();
-                    } catch (final Throwable t) {
+                    rawSession.commitAsync(null, t -> {
                         final ComponentLog procLog = new 
SimpleProcessLogger(connectable.getIdentifier(), 
connectable.getRunnableComponent());
                         procLog.error("Failed to commit session {} due to {}; 
rolling back", new Object[] { rawSession, t.toString() }, t);
-
-                        try {
-                            rawSession.rollback(true);

Review comment:
       I don't think we need to penalize. There are arguments for penalizing 
there. There are also arguments against it. The main argument against it is 
that if a FIFO Prioritizer or LIFO prioritizer is used, penalizing can change 
that ordering. And that may be undesirable. In fact, I think administratively 
yielding makes more sense than penalizing. But not sure that it's necessary to 
do either.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to