Skip to content

Commit

Permalink
Attempt to connect to additional addresses if fix initiator session i…
Browse files Browse the repository at this point in the history
…s unable_to_logon
  • Loading branch information
marc-adaptive committed Feb 10, 2025
1 parent f33def9 commit 53af6f5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import static uk.co.real_logic.artio.GatewayProcess.NO_CONNECTION_ID;
import static uk.co.real_logic.artio.messages.GatewayError.UNABLE_TO_CONNECT;
import static uk.co.real_logic.artio.messages.GatewayError.UNABLE_TO_LOGON;

/**
* .
Expand Down Expand Up @@ -70,7 +71,7 @@ protected void sendMessage()

void onError(final GatewayError errorType, final String errorMessage)
{
if (errorType == UNABLE_TO_CONNECT)
if (isExecuting() && (errorType == UNABLE_TO_CONNECT || errorType == UNABLE_TO_LOGON))
{
addressIndex++;
register();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ private void assertDisconnectRejected(final Reply<Session> reply, final boolean
{
assertEquals(reply.toString(), Reply.State.ERRORED, reply.state());
assertThat(reply.error().getMessage(),
containsString("UNABLE_TO_LOGON: Disconnected before session active"));
containsString("Unable to connect to any of the addresses specified"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ private void initiatorFailsToConnect() throws IOException

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

private Session completeLogon()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void failedAuthenticationWithInvalidCompId()
testSystem.awaitReply(failureReply);

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

@After
Expand Down

0 comments on commit 53af6f5

Please sign in to comment.