Only configure the media driver context to delete the dirs if this is the process that started it
This commit is contained in:
parent
818687c0d8
commit
e99448e066
@ -118,7 +118,7 @@ internal constructor(val type: Class<*>, internal val config: Configuration) : A
|
|||||||
internal val listenerManager = ListenerManager<CONNECTION>()
|
internal val listenerManager = ListenerManager<CONNECTION>()
|
||||||
internal val connections = ConnectionManager<CONNECTION>()
|
internal val connections = ConnectionManager<CONNECTION>()
|
||||||
|
|
||||||
internal var mediaDriverContext: MediaDriver.Context? = null
|
internal val mediaDriverContext: MediaDriver.Context
|
||||||
private var mediaDriver: MediaDriver? = null
|
private var mediaDriver: MediaDriver? = null
|
||||||
private var aeron: Aeron? = null
|
private var aeron: Aeron? = null
|
||||||
|
|
||||||
@ -250,8 +250,6 @@ internal constructor(val type: Class<*>, internal val config: Configuration) : A
|
|||||||
val mDrivercontext = MediaDriver.Context()
|
val mDrivercontext = MediaDriver.Context()
|
||||||
.publicationReservedSessionIdLow(RESERVED_SESSION_ID_LOW)
|
.publicationReservedSessionIdLow(RESERVED_SESSION_ID_LOW)
|
||||||
.publicationReservedSessionIdHigh(RESERVED_SESSION_ID_HIGH)
|
.publicationReservedSessionIdHigh(RESERVED_SESSION_ID_HIGH)
|
||||||
.dirDeleteOnStart(true)
|
|
||||||
.dirDeleteOnShutdown(true)
|
|
||||||
.conductorThreadFactory(threadFactory)
|
.conductorThreadFactory(threadFactory)
|
||||||
.receiverThreadFactory(threadFactory)
|
.receiverThreadFactory(threadFactory)
|
||||||
.senderThreadFactory(threadFactory)
|
.senderThreadFactory(threadFactory)
|
||||||
@ -294,10 +292,15 @@ internal constructor(val type: Class<*>, internal val config: Configuration) : A
|
|||||||
val aeronDirectory = config.aeronLogDirectory!!.absolutePath
|
val aeronDirectory = config.aeronLogDirectory!!.absolutePath
|
||||||
|
|
||||||
if (!isRunning()) {
|
if (!isRunning()) {
|
||||||
// the server always creates a the media driver.
|
|
||||||
mediaDriver = try {
|
|
||||||
logger.debug { "Starting Aeron Media driver..."}
|
logger.debug { "Starting Aeron Media driver..."}
|
||||||
MediaDriver.launch(mediaDriverContext)
|
|
||||||
|
mediaDriverContext
|
||||||
|
.dirDeleteOnStart(true)
|
||||||
|
.dirDeleteOnShutdown(true)
|
||||||
|
|
||||||
|
// the server always creates a the media driver.
|
||||||
|
try {
|
||||||
|
mediaDriver = MediaDriver.launch(mediaDriverContext)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
listenerManager.notifyError(e)
|
listenerManager.notifyError(e)
|
||||||
throw e
|
throw e
|
||||||
|
Loading…
Reference in New Issue
Block a user