You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing a JVM crash when closing the MediaDriver, which appears to be related to a previous attempt to close the Aeron client that failed due to thread interruption.
I am using Aeron 1.13.0 with Oracle JDK 1.8.0_191 on Linux.
Here is a short example that crashes:
importio.aeron.Aeron;
importio.aeron.Publication;
importio.aeron.driver.MediaDriver;
publicclassAeronCrashOnDriverCloseAfterInterruptBeforePublisherClose {
publicstaticvoidmain(String[] args) {
finalMediaDriver.ContextdriverCtx = newMediaDriver.Context();
// For cleanliness; not relevant.driverCtx.warnIfDirectoryExists(false).dirDeleteOnStart(true);
finalAeron.ContextclientCtx = newAeron.Context();
try (MediaDriverdriver = MediaDriver.launch(driverCtx);
Aeronclient = Aeron.connect(clientCtx);
Publicationpub = client.addPublication("aeron:ipc", 42))
{
// Comment this out and program exits normally.Thread.currentThread().interrupt();
}
}
}
The Publication#close() doesn't need to fail for the crash to happen. The determining factor seems to be whether the Aeron#close() was interrupted. Here is a slightly more verbose example with a successful Publication close:
importio.aeron.Aeron;
importio.aeron.Publication;
importio.aeron.driver.MediaDriver;
publicclassAeronCrashOnDriverCloseAfterInterruptBeforeClientClose {
publicstaticvoidmain(String[] args) {
finalMediaDriver.ContextdriverCtx = newMediaDriver.Context();
// For cleanliness; not relevant.driverCtx.warnIfDirectoryExists(false).dirDeleteOnStart(true);
finalAeron.ContextclientCtx = newAeron.Context();
finalMediaDriverdriver = MediaDriver.launch(driverCtx);
try {
finalAeronclient = Aeron.connect(clientCtx);
try {
// Need to add a Publication, or the crash will not happen.finalPublicationpub = client.addPublication("aeron:ipc", 42);
pub.close();
// Comment this out and program exits normally.Thread.currentThread().interrupt();
} finally {
// This will throw AeronException because of interrupt flag.// (Publication would sneaky-throw InterruptedException.)client.close();
}
} finally {
// This will cause JVM to crash if the Aeron#close() failed.driver.close();
}
}
}
I can provide an hs_err log if that helps.
Thank you.
The text was updated successfully, but these errors were encountered:
Hello,
I am experiencing a JVM crash when closing the MediaDriver, which appears to be related to a previous attempt to close the Aeron client that failed due to thread interruption.
I am using Aeron 1.13.0 with Oracle JDK 1.8.0_191 on Linux.
Here is a short example that crashes:
The Publication#close() doesn't need to fail for the crash to happen. The determining factor seems to be whether the Aeron#close() was interrupted. Here is a slightly more verbose example with a successful Publication close:
I can provide an hs_err log if that helps.
Thank you.
The text was updated successfully, but these errors were encountered: