adam-markovics commented on a change in pull request #1191:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1191#discussion_r724006315
##########
File path: libminifi/src/core/Processor.cpp
##########
@@ -379,25 +379,37 @@ std::shared_ptr<Connectable>
Processor::pickIncomingConnection() {
return getNextIncomingConnectionImpl(rel_guard);
}
-void Processor::validateAnnotations() const {
+void Processor::validateAnnotations() {
+ validateInputRequirements();
+ validateThreads();
+}
+
+void Processor::validateInputRequirements() const {
switch (getInputRequirement()) {
case annotation::Input::INPUT_REQUIRED: {
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;
}
}
}
+void Processor::validateThreads() {
+ if (isSingleThreaded() && max_concurrent_tasks_ > 1) {
+ logger_->log_warn("Processor %s can not be run in parallel, its \"max
concurrent tasks\" value is too high. "
+ "It was set to 1 from %d.", name_,
max_concurrent_tasks_);
+ max_concurrent_tasks_ = 1;
Review comment:
Done.
##########
File path: extensions/windows-event-log/ConsumeWindowsEventLog.cpp
##########
@@ -388,6 +389,12 @@ void ConsumeWindowsEventLog::onTrigger(const
std::shared_ptr<core::ProcessContex
return;
}
+ std::unique_lock<std::mutex> lock(on_trigger_mutex_, std::try_to_lock);
Review comment:
Done.
##########
File path: extensions/windows-event-log/ConsumeWindowsEventLog.cpp
##########
@@ -432,6 +439,7 @@ void ConsumeWindowsEventLog::onTrigger(const
std::shared_ptr<core::ProcessContex
}
wel::WindowsEventLogHandler ConsumeWindowsEventLog::getEventLogHandler(const
std::string & name) {
+ std::lock_guard<std::mutex> lock(cache_mutex_);
Review comment:
Done.
--
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]