You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/03/08 10:32:13 UTC

[GitHub] [nifi-minifi-cpp] fgerlits commented on a change in pull request #1013: MINIFICPP-1487 Do not trigger the processor if the incoming queue has penalized flow files only

fgerlits commented on a change in pull request #1013:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1013#discussion_r589321210



##########
File path: libminifi/src/core/Processor.cpp
##########
@@ -277,6 +286,28 @@ void Processor::onTrigger(const std::shared_ptr<ProcessContext> &context, const
   }
 }
 
+void Processor::callOnTrigger(const std::shared_ptr<ProcessContext>& context, const std::shared_ptr<ProcessSession>& session) {
+  uint64_t num_incoming_flow_files_queued_before = numIncomingFlowFilesQueued();
+  onTrigger(context, session);  // virtual method overridden by subclasses
+  uint64_t num_incoming_flow_files_queued_after = numIncomingFlowFilesQueued();
+
+  if (num_incoming_flow_files_queued_before != 0 && num_incoming_flow_files_queued_before == num_incoming_flow_files_queued_after) {

Review comment:
       I have rewritten the code to use a different approach: now `isWorkAvailable()` returns false when all the incoming flow files are penalized.  This will cause the processor to yield for a `nifi.bored.yield.duration` amount of time, so it will no longer spin in a tight loop.




----------------------------------------------------------------
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:
users@infra.apache.org