szaszm commented on code in PR #2292:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2292#discussion_r4470955197
##########
libminifi/src/c2/C2Agent.cpp:
##########
@@ -179,6 +200,17 @@ void C2Agent::configure(const std::shared_ptr<Configure>
&configure, bool reconf
}
logger_->log_debug("Using {} as the heartbeat period", heart_beat_period_);
+ c2_connection_timeout_ = parseTimeoutPeriod(configuration_,
std::string{Configuration::nifi_c2_connection_timeout}, logger_);
+ if (c2_connection_timeout_ && *c2_connection_timeout_ <= heart_beat_period_)
{
+ logger_->log_warn(
+ "C2 connection timeout is less than the heartbeat period: c2
connection timeout={}, heartbeat period={}. Adjusting it to be twice the "
+ "heartbeat period",
+ *c2_connection_timeout_,
+ heart_beat_period_);
+ c2_connection_timeout_ = heart_beat_period_ * 2;
+ logger_->log_debug("Using {} as the C2 connection timeout",
*c2_connection_timeout_);
+ }
Review Comment:
I didn't think it's important enough to comment on it, since the primary use
case is having long configured timeouts, but otherwise I agree, we might as
well make it not weird :)
--
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]