Fixed issues with recursive aeron directory name

This commit is contained in:
Robinson 2023-08-07 00:09:14 -06:00
parent ac42a8be7e
commit 08d58fd6fd
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 18 additions and 8 deletions

View File

@ -902,18 +902,28 @@ abstract class Configuration protected constructor() {
*/
var dir = aeronDirectory
if (forceAllowSharedAeronDriver && dir != null) {
logger.warn { "Forcing the Aeron driver to be shared between processes. THIS IS DANGEROUS!" }
} else if (dir != null) {
// we have defined an aeron directory
dir = File(dir.absolutePath + "_$appId")
} else {
if (dir != null) {
if (forceAllowSharedAeronDriver) {
logger.warn { "Forcing the Aeron driver to be shared between processes. THIS IS DANGEROUS!" }
} else if (!dir.absolutePath.endsWith(appId)) {
// we have defined an aeron directory
dir = File(dir.absolutePath + "_$appId")
}
}
else {
val baseFileLocation = defaultAeronLogLocation(logger)
val prefix = if (appId.startsWith("aeron_")) {
""
} else {
"aeron_"
}
val aeronLogDirectory = if (uniqueAeronDirectory) {
// this is incompatible with IPC, and will not be set if IPC is enabled (error will be thrown on validate)
File(baseFileLocation, "aeron_${appId}_${mediaDriverIdNoDir()}")
File(baseFileLocation, "$prefix${appId}_${mediaDriverIdNoDir()}")
} else {
File(baseFileLocation, "aeron_$appId")
File(baseFileLocation, "$prefix$appId")
}
dir = aeronLogDirectory.absoluteFile
}