-
Notifications
You must be signed in to change notification settings - Fork 969
Closed
Labels
Description
Following snippet sometimes throws TimeoutException on archive.stopRecording(channel, 1); line.
String aeronDirName = Files.createTempDirectory("md").toString();
try (ArchivingMediaDriver mediaDriver = ArchivingMediaDriver.launch(
new MediaDriver.Context()
.threadingMode(ThreadingMode.SHARED)
.aeronDirectoryName(aeronDirName),
new Archive.Context()
.aeronDirectoryName(aeronDirName)
.threadingMode(ArchiveThreadingMode.SHARED)
.archiveDir(Files.createTempDirectory("ar").toFile())
)) {
try (Aeron aeron = Aeron.connect(new Aeron.Context()
.aeronDirectoryName(mediaDriver.mediaDriver().aeronDirectoryName()));
AeronArchive archive = AeronArchive.connect(new AeronArchive.Context()
.aeron(aeron)))
{
String channel = "aeron:udp?endpoint=127.0.0.1:9000";
archive.startRecording(channel, 1, SourceLocation.LOCAL);
archive.startRecording(channel, 2, SourceLocation.LOCAL);
aeron.addPublication(channel, 1);
aeron.addPublication(channel, 2);
archive.stopRecording(channel, 1);
archive.stopRecording(channel, 2);
}
}