You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/04/16 23:50:35 UTC

[GitHub] [nifi-minifi-cpp] msharee9 commented on a change in pull request #759: MINIFICPP-1193 - heartbeat interval config doesn't work properly

msharee9 commented on a change in pull request #759: MINIFICPP-1193 - heartbeat interval config doesn't work properly
URL: https://github.com/apache/nifi-minifi-cpp/pull/759#discussion_r409913141
 
 

 ##########
 File path: libminifi/src/c2/C2Agent.cpp
 ##########
 @@ -90,22 +87,16 @@ C2Agent::C2Agent(const std::shared_ptr<core::controller::ControllerServiceProvid
         request_mutex.unlock();
       }
 
-      if ( time_since > heart_beat_period_ ) {
-        last_run_ = now;
-        try {
-          performHeartBeat();
-        }
-        catch(const std::exception &e) {
-          logger_->log_error("Exception occurred while performing heartbeat. error: %s", e.what());
-        }
-        catch(...) {
-          logger_->log_error("Unknonwn exception occurred while performing heartbeat.");
-        }
+      try {
+        performHeartBeat();
+      } catch(const std::exception &e) {
+        logger_->log_error("Exception occurred while performing heartbeat. error: %s", e.what());
+      } catch(...) {
+        logger_->log_error("Unknonwn exception occurred while performing heartbeat.");
       }
 
       checkTriggers();
 
-      std::this_thread::sleep_for(std::chrono::milliseconds(heart_beat_period_ > 500 ? 500 : heart_beat_period_));
 
 Review comment:
   Do we honor the heartbeat period here? I mean doesn't the threadpool schedule this task immediately or at a different delay interval that the heartbeat period.
   Also, I believe this PR will conflict with MINFICPP-1169. In that PR we are using the new theadpool changes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services