arpadboda commented on a change in pull request #974:
URL: https://github.com/apache/nifi-minifi-cpp/pull/974#discussion_r560320178



##########
File path: libminifi/src/FlowController.cpp
##########
@@ -360,6 +360,33 @@ int16_t FlowController::start() {
   }
 }
 
+int16_t FlowController::pause() {
+  std::lock_guard<std::recursive_mutex> flow_lock(mutex_);
+  if (!running_) {
+    logger_->log_warn("Can not pause flow controller that is not running");
+    return 0;
+  }
+
+  logger_->log_info("Pausing Flow Controller");
+  timer_scheduler_->pause();

Review comment:
       As far as I remember the threadpool is currently the member of 
flowcontroller. 
   Only a reference to that is passed to all schedulers, so schedulers share a 
common threadpool. 
   
   Which means that we notify all scheduling agents to indirectly pause our own 
threadpool, but at least it's done 3 times. :)
   
   I don't think that the scheduling agents even need to be aware to being 
paused and resumed. I doens't hurt, but I think pausing the threadpool should 
be the responsibility of the flowcontroller, which makes this code less 
complex, too. 
   




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