Skip to content

Commit 2b453da

Browse files
reissGRVSreiss-greaves
authored and
reiss-greaves
committed
[C++] Make MediaDriver keepalive exception consistent
Makes the keepalive timeout exception consistent with implementation in aeron_client_conductor_check_liveness
1 parent b167f5d commit 2b453da

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

aeron-client/src/main/cpp/ClientConductor.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,14 @@ class CLIENT_EXPORT ClientConductor
446446

447447
if (nowMs > (m_timeOfLastKeepaliveMs + KEEPALIVE_TIMEOUT_MS))
448448
{
449-
if (nowMs > (m_driverProxy.timeOfLastDriverKeepalive() + m_driverTimeoutMs))
449+
450+
int64_t lastKeepaliveMs = m_driverProxy.timeOfLastDriverKeepalive();
451+
if (nowMs > (lastKeepaliveMs + m_driverTimeoutMs))
450452
{
451453
m_driverActive = false;
452454

453-
int64_t age = m_driverProxy.timeOfLastDriverKeepalive() + m_driverTimeoutMs;
454455
DriverTimeoutException exception(
455-
"MediaDriver keepalive: age=" + std::to_string(age) +
456+
"MediaDriver keepalive: age=" + std::to_string(nowMs - lastKeepaliveMs) +
456457
"ms > timeout=" + std::to_string(m_driverTimeoutMs) + "ms", SOURCEINFO);
457458
m_errorHandler(exception);
458459
}

0 commit comments

Comments
 (0)