Fixed out-of-order initialization of aeron dir

This commit is contained in:
nathan 2020-09-11 02:02:46 +02:00
parent 960d1e4660
commit e5bcd3cb1a

View File

@ -174,12 +174,12 @@ internal object AeronConfig {
fun createContext(config: Configuration, logger: KLogger = KotlinLogging.logger("AeronConfig")): MediaDriver.Context {
var context = create(config, logger)
// will setup the aeron directory or throw IllegalArgumentException if it cannot be configured
var aeronDir = context.aeronDirectory()
// this happens EXACTLY once. Must be BEFORE the "isRunning" check!
context.concludeAeronDirectory()
// will setup the aeron directory or throw IllegalArgumentException if it cannot be configured
var aeronDir = context.aeronDirectory()
var isRunning = isRunning(context)
// this is incompatible with IPC, and will not be set if IPC is enabled