Connection retries are SLIGHTLY slower than the aeron driver timeout.

This commit is contained in:
Robinson 2022-07-17 23:12:06 -04:00
parent 9073769e15
commit 72b95b5cbe
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
2 changed files with 10 additions and 1 deletions

View File

@ -493,7 +493,8 @@ open class Client<CONNECTION : Connection>(
aeronDriver.start()
// short delay, since it failed we want to limit the retry rate to something slower than "as fast as the CPU can do it"
delay(500)
// we also want to go at SLIGHTLY slower that the aeron driver timeout frequency, this way - if there are connection or handshake issues, the server has the chance to expire the connections.
delay(aeronDriver.driverTimeout()+1)
if (logger.isTraceEnabled) {
logger.trace(e) { "Unable to connect to '$remoteAddressString', retrying..." }
} else {

View File

@ -488,6 +488,14 @@ class AeronDriver(
}
}
/**
* @return the aeron driver timeout
*/
fun driverTimeout(): Long {
return context.driverTimeout
}
/**
* @return the aeron media driver log file for a specific publication. This should be removed when a publication is closed (but is not always!)
*/