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



##########
File path: 
nifi-nar-bundles/nifi-windows-event-log-bundle/nifi-windows-event-log-processors/src/main/java/org/apache/nifi/processors/windows/event/log/ConsumeWindowsEventLog.java
##########
@@ -340,16 +339,10 @@ private int processQueue(ProcessSession session) {
             flowFile = session.putAttribute(flowFile, 
CoreAttributes.MIME_TYPE.key(), APPLICATION_XML);
             session.getProvenanceReporter().receive(flowFile, provenanceUri);
             session.transfer(flowFile, REL_SUCCESS);
-            session.commit();
             flowFileCount++;
-            if (!renderedXMLs.remove(xml) && getLogger().isWarnEnabled()) {
-                getLogger().warn(new StringBuilder("Event ")
-                        .append(xml)
-                        .append(" had already been removed from queue, 
FlowFile ")
-                        
.append(flowFile.getAttribute(CoreAttributes.UUID.key()))
-                        .append(" possible duplication of data")
-                        .toString());
-            }
+
+            final String xmlMessage = xml;
+            session.commitAsync(() -> renderedXMLs.remove(xmlMessage));

Review comment:
       Given the current implementations of 
StandardProcessSession/StatelessProcessSession, it won't be. But given that we 
don't document the exact behavior, and that could change in the future, I 
suppose this could one day become an issue. Will update it.




-- 
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