szaszm commented on a change in pull request #1191:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1191#discussion_r721800060



##########
File path: libminifi/src/core/Processor.cpp
##########
@@ -385,17 +385,20 @@ void Processor::validateAnnotations() const {
       if (!hasIncomingConnections()) {
         throw Exception(PROCESS_SCHEDULE_EXCEPTION, "INPUT_REQUIRED was 
specified for the processor, but no incoming connections were found");
       }
-      return;
+      break;
     }
     case annotation::Input::INPUT_ALLOWED:
-      return;
+      break;
     case annotation::Input::INPUT_FORBIDDEN: {
       if (hasIncomingConnections()) {
         throw Exception(PROCESS_SCHEDULE_EXCEPTION, "INPUT_FORBIDDEN was 
specified for the processor, but there are incoming connections");
       }
-      return;
     }
   }
+
+  if (isSingleThreaded() && max_concurrent_tasks_ > 1) {
+    throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Processor can not be run in 
parallel, its \"max concurrent tasks\" value is too high. It must be set to 
1.");
+  }

Review comment:
       Consider separating input requirement validation and concurrency 
validation into separate functions, so that one function does only one thing.
   I also think that instead of preventing the processor from working 
altogether, it would be better to override max_concurrent_tasks_ to one and log 
a warning. 




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

To unsubscribe, e-mail: [email protected]

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


Reply via email to