szaszm commented on a change in pull request #721: MINIFICPP-1135 - Add a 
watchdog to schedulingAgent to warn in case of…
URL: https://github.com/apache/nifi-minifi-cpp/pull/721#discussion_r373424752
 
 

 ##########
 File path: libminifi/include/SchedulingAgent.h
 ##########
 @@ -131,11 +136,16 @@ class SchedulingAgent {
     auto pool = utils::ThreadPool<uint64_t>(csThreads, false, 
controller_service_provider, "SchedulingAgent");
     thread_pool_ = std::move(pool);
     thread_pool_.start();
+
+    std::function<void(void)> f = std::bind(&SchedulingAgent::watchDogFunc, 
this);
+    watchDogTimer_.reset(new 
utils::CallBackTimer(std::chrono::milliseconds(SCHEDULING_WATCHDOG_CHECK_PERIOD),
 f));
+    watchDogTimer_->start();
   }
   // Destructor
   virtual ~SchedulingAgent() {
-
+    watchDogTimer_->stop();
 
 Review comment:
   By removing the dtor, you've made it non-virtual, which is also problematic 
because there are derived classes from `SchedulingAgent`.
   I'd suggest `virtual ~SchedulingAgent() = default;`, possibly `noexcept` if 
all the member and derived class dtors are also `noexcept`.

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