Skip to content

Commit

Permalink
fixing another indeterminism around index update
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianoviana committed Oct 21, 2024
1 parent def65ec commit 60ea14c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,6 @@ public void shouldAcceptReEstablishmentOfSession() throws IOException

restartArtio();

// if not this, then sometimes the 'alreadyRecvMsgCount' does not match 'nextSeqNo' below when calling
// readEstablishAck
awaitIndexerCaughtUp(testSystem, mediaDriver.mediaDriver().aeronDirectoryName(), engine, library);
reEstablishConnection(3, 3);
}

Expand Down Expand Up @@ -2193,6 +2190,10 @@ private void withReEstablishedConnection(
{
try (BinaryEntryPointClient client = newClient())
{
// if not this, then sometimes the 'alreadyRecvMsgCount' does not match 'nextSeqNo' below when calling
// readEstablishAck
awaitIndexerCaughtUp(testSystem, mediaDriver.mediaDriver().aeronDirectoryName(), engine, library);

final int nextSeqNo = alreadyRecvMsgCount + 1;
client.writeEstablish(nextSeqNo);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,10 @@ public void shouldSupportLogonBasedSequenceNumberResetWithMessagesSentBeforeLogo
testSystem.awaitMessageOf(otfAcceptor, EXECUTION_REPORT_MESSAGE_AS_STR,
msg -> msg.messageSequenceNumber() == seqNum2 && msg.sequenceIndex() == 1);

// to ensure the indexes are processed before resend request is received - which would mean a gapfill
// responded rather than a replay msg
awaitIndexerCaughtUp(testSystem, mediaDriver.mediaDriver().aeronDirectoryName(), engine, library);

connection.sendResendRequest(2, 2);
testSystem.awaitBlocking(
() -> assertEquals(Side.SELL, connection.readResentExecutionReport(2).sideAsEnum()));
Expand Down

0 comments on commit 60ea14c

Please sign in to comment.