Fixed driver liveliness checks

This commit is contained in:
Robinson 2023-07-11 00:02:40 +02:00
parent cba66a6959
commit ebad4d234b
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C

View File

@ -727,7 +727,7 @@ internal class AeronDriverInternal(endPoint: EndPoint<*>?, private val config: C
return@withLock false
}
val removed = AeronDriver.driverConfigurations.remove(driverId)
val removed = AeronDriver.driverConfigurations[driverId]
if (removed == null) {
logger.debug { "Aeron Driver [$driverId]: already closed. Ignoring close request." }
return@withLock false
@ -834,6 +834,8 @@ internal class AeronDriverInternal(endPoint: EndPoint<*>?, private val config: C
// reset our contextDefine value, so that this configuration can safely be reused
config.contextDefined = false
// actually remove it, since we've passed all the checks to guarantee it's closed...
AeronDriver.driverConfigurations.remove(driverId)
closed = true
return true