diff --git a/aeron-archive/src/main/java/io/aeron/archive/ControlSessionAdapter.java b/aeron-archive/src/main/java/io/aeron/archive/ControlSessionAdapter.java index 8833731700..d0fd98e443 100644 --- a/aeron-archive/src/main/java/io/aeron/archive/ControlSessionAdapter.java +++ b/aeron-archive/src/main/java/io/aeron/archive/ControlSessionAdapter.java @@ -1061,22 +1061,8 @@ void abortControlSessionByImage(final Image image) void removeControlSession(final long controlSessionId) { - final SessionInfo info = controlSessionByIdMap.remove(controlSessionId); + controlSessionByIdMap.remove(controlSessionId); conductor.removeReplayTokensForSession(controlSessionId); - if (null != info) - { - if (info.controlSession.isInactive() && info.image.activeTransportCount() > 0) - { - final ExclusivePublication controlPublication = info.controlSession.controlPublication(); - final int publicationSessionId = controlPublication.sessionId(); - if (info.image.sessionId() == publicationSessionId || - info.image.correlationId() == Long.parseLong( - ChannelUri.parse(controlPublication.channel()).get(RESPONSE_CORRELATION_ID_PARAM_NAME, "-1"))) - { - info.image.reject("stale ControlSession: sessionId=" + info.controlSession.sessionId()); - } - } - } } private ControlSession setupSessionAndChannelForReplay( diff --git a/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java b/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java index 8161b01090..c99d06c16b 100644 --- a/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java +++ b/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java @@ -870,7 +870,7 @@ void shouldTimeoutInactiveArchiveClients(final String controlRequestChannel, fin try (MediaDriver driver = MediaDriver.launch(new MediaDriver.Context() .aeronDirectoryName(CommonContext.generateRandomDirName()) .statusMessageTimeoutNs(TimeUnit.MILLISECONDS.toNanos(80)) - .imageLivenessTimeoutNs(TimeUnit.MILLISECONDS.toNanos(2000)) + .imageLivenessTimeoutNs(TimeUnit.MILLISECONDS.toNanos(1000)) .timerIntervalNs(TimeUnit.MILLISECONDS.toNanos(100)) .enableExperimentalFeatures(true)); Archive archive = Archive.launch(TestContexts.localhostArchive() @@ -881,7 +881,7 @@ void shouldTimeoutInactiveArchiveClients(final String controlRequestChannel, fin .archiveId(archiveId) .archiveDir(tmpDir.resolve("archive").toFile()) .aeronDirectoryName(driver.context().aeronDirectoryName()) - .connectTimeoutNs(TimeUnit.MILLISECONDS.toNanos(1000)) + .connectTimeoutNs(TimeUnit.MILLISECONDS.toNanos(500)) .sessionLivenessCheckIntervalNs(TimeUnit.MILLISECONDS.toNanos(1)))) { final AeronArchive.Context ctx = new AeronArchive.Context() @@ -927,9 +927,7 @@ void shouldTimeoutInactiveArchiveClients(final String controlRequestChannel, fin assertTrue(client1.archiveProxy().publication().isConnected()); assertTrue(client1.controlResponsePoller().subscription().isConnected()); - assertEquals( - controlRequestChannel.startsWith(CommonContext.IPC_CHANNEL), - client2.archiveProxy().publication().isConnected()); + assertTrue(client2.archiveProxy().publication().isConnected()); assertFalse(client2.controlResponsePoller().subscription().isConnected()); } } diff --git a/aeron-client/src/main/java/io/aeron/Image.java b/aeron-client/src/main/java/io/aeron/Image.java index e48751d3bd..2edc38fa46 100644 --- a/aeron-client/src/main/java/io/aeron/Image.java +++ b/aeron-client/src/main/java/io/aeron/Image.java @@ -830,13 +830,7 @@ public int rawPoll(final RawBlockHandler handler, final int blockLengthLimit) return length; } - /** - * Force the driver to disconnect this image from the remote publication. - * - * @param reason an error message to be forwarded back to the publication. - * @since 1.47.0 - */ - public void reject(final String reason) + void reject(final String reason) { subscription.rejectImage(correlationId, position(), reason); }