// However, if all pings timed out even in burst mode, then we still declare
// the line down
if (InBurstMode && PingCongestionCount >= PingsPerformedCount)
+ {
+ GlobalLogger.notice() << log_prefix() << "All pings timed out despite "
+ << "using more pings per IP --> assume connection is really down";
ExceededPingFailedLimit = true;
+ }
// notify if the amount of pings that failed exceed the limit
if ( exceeded_ping_failed_limit() )
using boost::shared_ptr;
using I2n::Logger::GlobalLogger;
+
//-----------------------------------------------------------------------------
// PingScheduler
//-----------------------------------------------------------------------------
LinkStatusItem link_analyzer,
const int first_delay,
const int n_parallel_pings,
- const int parallel_ping_delay
+ const int parallel_ping_delay,
+ const int ping_timeout_factor
) :
IoService( io_serv ),
NetworkInterfaceName( network_interface ),
NextPingTimer( *io_serv ),
TimeSentLastPing( microsec_clock::universal_time() ),
PingReplyTimeout( ping_reply_timeout ),
+ PingReplyTimeoutOrig( ping_reply_timeout ),
HostAnalyzer( destination_address, ping_fail_percentage_limit,
ping_congestion_percentage_limit,
ping_congestion_duration_thresh, n_parallel_pings,
DelayedPingTimer( *io_serv ),
WantToPing( false ),
LogPrefix(),
- ContinueOnOutdatedIps( false )
+ ContinueOnOutdatedIps( false ),
+ PingTimeoutFactor( ping_timeout_factor )
{
BOOST_ASSERT( !network_interface.empty() );
BOOST_ASSERT( !destination_address.empty() );
GlobalLogger.debug() << LogPrefix << "- Speeding up ping interval to: "
<< PingIntervalInSec << "s";
+ PingReplyTimeout = PingReplyTimeoutOrig * PingTimeoutFactor;
+ GlobalLogger.debug() << LogPrefix << "- Increase ping timeout to "
+ << PingReplyTimeout << "s";
}
else
{
GlobalLogger.debug() << LogPrefix << "- Stick to the original ping "
<< "interval: " << PingIntervalInSec << "s";
+ PingReplyTimeout = PingReplyTimeoutOrig;
+ GlobalLogger.debug() << LogPrefix << "- Reset ping timeout to "
+ << PingReplyTimeout << "s";
}
}
LinkStatusItem link_analyzer,
const int first_delay,
const int n_parallel_pings,
- const int parallel_ping_delay
+ const int parallel_ping_delay,
+ const int ping_timeout_factor
);
~PingScheduler();
/// Keeps track of the time when the last ping was send
boost::posix_time::ptime TimeSentLastPing;
/// time threshold for ping
- const int PingReplyTimeout;
+ int PingReplyTimeout;
+ /// time threshold for ping -- original value
+ const int PingReplyTimeoutOrig;
/// Object responsible to evaluate the status of the host
HostStatus HostAnalyzer;
/// The Dns resolver
std::string LogPrefix;
/// Flag whether DNS resolution has failed so we have to run on outdated IPs
bool ContinueOnOutdatedIps;
+ int PingTimeoutFactor;
};
//-----------------------------------------------------------------------------