bakaid commented on a change in pull request #683: MINIFICPP-1087 - Proper 
handling of errors during onSchedule calls
URL: https://github.com/apache/nifi-minifi-cpp/pull/683#discussion_r351734579
 
 

 ##########
 File path: libminifi/src/core/ProcessGroup.cpp
 ##########
 @@ -156,6 +168,49 @@ void ProcessGroup::startProcessing(const 
std::shared_ptr<TimerDrivenSchedulingAg
           break;
       }
     }
+    catch (const std::exception &e) {
+      logger_->log_error("Failed to start processor %s (%s): %s", 
processor->getUUIDStr(), processor->getName(), e.what());
+      failed_processors.insert(processor);
+    }
+    catch (...) {
+      logger_->log_error("Failed to start processor %s (%s)", 
processor->getUUIDStr(), processor->getName());
+      failed_processors.insert(processor);
+    }
+  }
+  failed_processors_ = std::move(failed_processors);
+
+  for (auto& processor : failed_processors_) {
+    try {
+      processor->onUnSchedule();
 
 Review comment:
   I agree that by default this should be notifyStop, but I like that it is 
overrideable by the implementation, because it leaves space for smarter 
failure-handling logics, so I am OK with this as it is.

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


With regards,
Apache Git Services

Reply via email to