Skip to content

Commit 53af6f5

Browse files
committed
Attempt to connect to additional addresses if fix initiator session is unable_to_logon
1 parent f33def9 commit 53af6f5

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

artio-core/src/main/java/uk/co/real_logic/artio/library/InitiateSessionReply.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import static uk.co.real_logic.artio.GatewayProcess.NO_CONNECTION_ID;
2727
import static uk.co.real_logic.artio.messages.GatewayError.UNABLE_TO_CONNECT;
28+
import static uk.co.real_logic.artio.messages.GatewayError.UNABLE_TO_LOGON;
2829

2930
/**
3031
* .
@@ -70,7 +71,7 @@ protected void sendMessage()
7071

7172
void onError(final GatewayError errorType, final String errorMessage)
7273
{
73-
if (errorType == UNABLE_TO_CONNECT)
74+
if (isExecuting() && (errorType == UNABLE_TO_CONNECT || errorType == UNABLE_TO_LOGON))
7475
{
7576
addressIndex++;
7677
register();

artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/AsyncAuthenticatorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ private void assertDisconnectRejected(final Reply<Session> reply, final boolean
386386
{
387387
assertEquals(reply.toString(), Reply.State.ERRORED, reply.state());
388388
assertThat(reply.error().getMessage(),
389-
containsString("UNABLE_TO_LOGON: Disconnected before session active"));
389+
containsString("Unable to connect to any of the addresses specified"));
390390
}
391391
}
392392

artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/MessageBasedInitiatorSystemTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ private void initiatorFailsToConnect() throws IOException
509509

510510
final Reply<Session> reply = testSystem.awaitReply(this.sessionReply);
511511
assertEquals(ERRORED, reply.state());
512-
assertThat(reply.error().toString(), containsString("UNABLE_TO_LOGON"));
512+
assertThat(reply.error().toString(), containsString("Unable to connect to any of the addresses specified"));
513513
}
514514

515515
private Session completeLogon()

artio-system-tests/src/test/java/uk/co/real_logic/artio/system_tests/MultipleConnectionSystemTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private void failedAuthenticationWithInvalidCompId()
8383
testSystem.awaitReply(failureReply);
8484

8585
assertEquals(Reply.State.ERRORED, failureReply.state());
86-
assertEquals("UNABLE_TO_LOGON: Disconnected before session active", failureReply.error().getMessage());
86+
assertEquals("Unable to connect to any of the addresses specified", failureReply.error().getMessage());
8787
}
8888

8989
@After

0 commit comments

Comments
 (0)