Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AeronArchive timeouts on connect #525

Closed
zyulyaev opened this issue Jul 11, 2018 · 1 comment
Closed

AeronArchive timeouts on connect #525

zyulyaev opened this issue Jul 11, 2018 · 1 comment

Comments

@zyulyaev
Copy link

Following snippet throws TimeoutException on second AeronArchive.connect.

String archivingDir = Files.createTempDirectory("md").toString();
String clientDir = Files.createTempDirectory("md").toString();
try (ArchivingMediaDriver archivingDriver = ArchivingMediaDriver.launch(
    new MediaDriver.Context()
        .aeronDirectoryName(archivingDir)
        .threadingMode(ThreadingMode.SHARED),
    new Archive.Context()
        .aeronDirectoryName(archivingDir)
        .threadingMode(ArchiveThreadingMode.SHARED)
        .archiveDir(Files.createTempDirectory("ar").toFile()));
     MediaDriver clientDriver = MediaDriver.launch(new MediaDriver.Context()
         .aeronDirectoryName(clientDir)))
{
    try (Aeron aeron = Aeron.connect(new Aeron.Context()
        .aeronDirectoryName(clientDir)))
    {
        AeronArchive archive = AeronArchive.connect(new AeronArchive.Context()
            .aeron(aeron));
    }

    Thread.sleep(1000);

    try (Aeron aeron = Aeron.connect(new Aeron.Context()
        .aeronDirectoryName(clientDir));
         AeronArchive archive = AeronArchive.connect(new AeronArchive.Context()
             .aeron(aeron)))
    {

    }
}
@zyulyaev
Copy link
Author

Looks like the problem is due to reusing archive egress publication, which leads to sending connect response before client's subscription actually connected.
Can be fixed by using exclusive publication instead.

mjpt777 added a commit that referenced this issue Jul 12, 2018
@mjpt777 mjpt777 closed this as completed Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants