Added starting the aeron driver if necessary when clients are reconnecting

This commit is contained in:
Robinson 2022-07-12 10:56:47 -04:00
parent 2c1155943e
commit 3893a9be5a
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C

View File

@ -480,6 +480,9 @@ open class Client<CONNECTION : Connection>(
} catch (e: ClientRetryException) { } catch (e: ClientRetryException) {
handshake.reset() handshake.reset()
// maybe the aeron driver isn't running?
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" // 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) delay(500)
if (logger.isTraceEnabled) { if (logger.isTraceEnabled) {
@ -523,9 +526,10 @@ open class Client<CONNECTION : Connection>(
} }
// MAYBE the server doesn't have IPC enabled? If no, we need to connect via network instead // MAYBE the server doesn't have IPC enabled? If no, we need to connect via network instead
val ipcConnection = IpcMediaDriverConnection(streamIdSubscription = ipcSubscriptionId, val ipcConnection = IpcMediaDriverConnection(
streamId = ipcPublicationId, streamIdSubscription = ipcSubscriptionId,
sessionId = AeronDriver.RESERVED_SESSION_ID_INVALID streamId = ipcPublicationId,
sessionId = AeronDriver.RESERVED_SESSION_ID_INVALID,
) )
// throws a ConnectTimedOutException if the client cannot connect for any reason to the server handshake ports // throws a ConnectTimedOutException if the client cannot connect for any reason to the server handshake ports