update to Aeron 1.2.4, and fix the SharedMediaDriverSupport, #22693
* SharedMediaDriverSupport failed with NPE with Aeron 1.2.4, and concludeAeronDirectory solves that
This commit is contained in:
parent
1676da0553
commit
3d0d50e98b
2 changed files with 10 additions and 3 deletions
|
|
@ -43,17 +43,24 @@ object SharedMediaDriverSupport {
|
||||||
.threadingMode(ThreadingMode.SHARED)
|
.threadingMode(ThreadingMode.SHARED)
|
||||||
.sharedIdleStrategy(TaskRunner.createIdleStrategy(idleCpuLevel))
|
.sharedIdleStrategy(TaskRunner.createIdleStrategy(idleCpuLevel))
|
||||||
|
|
||||||
|
// concludeAeronDirectory needed for Aeron 1.2.4, otherwise NPE from isDriverActive
|
||||||
|
driverContext.concludeAeronDirectory()
|
||||||
|
|
||||||
// Check if the media driver is already started by another multi-node jvm.
|
// Check if the media driver is already started by another multi-node jvm.
|
||||||
// It checks more than one time with a sleep inbetween. The number of checks
|
// It checks more than one time with a sleep inbetween. The number of checks
|
||||||
// depends on the multi-node index (i).
|
// depends on the multi-node index (i).
|
||||||
@tailrec def isDriverInactive(i: Int): Boolean = {
|
@tailrec def isDriverInactive(i: Int): Boolean = {
|
||||||
if (i < 0) true
|
if (i < 0) true
|
||||||
else {
|
else {
|
||||||
val active = driverContext.isDriverActive(5000, new Consumer[String] {
|
val active = try driverContext.isDriverActive(5000, new Consumer[String] {
|
||||||
override def accept(msg: String): Unit = {
|
override def accept(msg: String): Unit = {
|
||||||
println(msg)
|
println(msg)
|
||||||
}
|
}
|
||||||
})
|
}) catch {
|
||||||
|
case NonFatal(e) ⇒
|
||||||
|
println(e.getMessage)
|
||||||
|
false
|
||||||
|
}
|
||||||
if (active) false
|
if (active) false
|
||||||
else {
|
else {
|
||||||
Thread.sleep(500)
|
Thread.sleep(500)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ object Dependencies {
|
||||||
val sslConfigVersion = "0.2.1"
|
val sslConfigVersion = "0.2.1"
|
||||||
val slf4jVersion = "1.7.23"
|
val slf4jVersion = "1.7.23"
|
||||||
val scalaXmlVersion = "1.0.6"
|
val scalaXmlVersion = "1.0.6"
|
||||||
val aeronVersion = "1.2.3"
|
val aeronVersion = "1.2.4"
|
||||||
|
|
||||||
val Versions = Seq(
|
val Versions = Seq(
|
||||||
crossScalaVersions := Seq("2.11.8", "2.12.1"),
|
crossScalaVersions := Seq("2.11.8", "2.12.1"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue