Skip to content

Commit

Permalink
[Java] Fix shouldRejoinAfterResting test.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyazelenko committed Dec 17, 2024
1 parent 42b7a2c commit b066904
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void shouldRejoinAfterResting(final String channel)
srcBuffer.setMemory(0, MESSAGE_LENGTH, (byte)-1);
final String untetheredChannel = channel + "|tether=false";
final String publicationChannel = channel.startsWith("aeron-spy") ? channel.substring(10) : channel;
int untetheredPollLimit = 3;
boolean pollingUntethered = true;

try (Subscription tetheredSub = aeron.addSubscription(channel, STREAM_ID);
Subscription untetheredSub = aeron.addSubscription(
Expand All @@ -205,9 +205,9 @@ void shouldRejoinAfterResting(final String channel)
aeron.conductorAgentInvoker().invoke();
}

if (untetheredPollLimit > 0 && untetheredSub.poll(fragmentHandler, FRAGMENT_COUNT_LIMIT) > 0)
if (pollingUntethered && untetheredSub.poll(fragmentHandler, FRAGMENT_COUNT_LIMIT) > 0)
{
untetheredPollLimit--;
pollingUntethered = false;
}

tetheredSub.poll(fragmentHandler, FRAGMENT_COUNT_LIMIT);
Expand Down

0 comments on commit b066904

Please sign in to comment.