Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from real-logic:master #2280

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ else if (udpChannel.hasExplicitEndpoint() && !udpChannel.isMulticast())
{
timeOfLastResolutionNs = nowNs;
final String endpoint = udpChannel.channelUri().get(CommonContext.ENDPOINT_PARAM_NAME);
conductorProxy.reResolveEndpoint(endpoint, this, udpChannel.remoteData());
conductorProxy.reResolveEndpoint(endpoint, this, connectAddress);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,60 @@ void shouldReResolveEndpointOnNotConnected()
any(Header.class));
}

@SlowTest
@Test
@InterruptAfter(30)
void shouldReResolveEndpointOnNotConnectedWhenNamePointsBackAtTheOriginalAddress()
{
final long initialResolutionChanges = countersReader.getCounterValue(RESOLUTION_CHANGES.id());

buffer.putInt(0, 1);

subscription = client.addSubscription(FIRST_SUBSCRIPTION_URI, STREAM_ID);
publication = client.addPublication(PUBLICATION_URI, STREAM_ID);

Tests.awaitConnected(publication);
Tests.awaitConnected(subscription);

while (publication.offer(buffer, 0, BitUtil.SIZE_OF_INT) < 0L)
{
Tests.yieldingIdle("No message offer to first subscription");
}

while (subscription.poll(handler, 1) <= 0)
{
Tests.yieldingIdle("No message received on first subscription");
}

subscription.close();

// wait for disconnect to ensure we stay in lock step
while (publication.isConnected())
{
Tests.sleep(10);
}

subscription = client.addSubscription(SECOND_SUBSCRIPTION_URI, STREAM_ID);

assertTrue(updateNameResolutionStatus(countersReader, ENDPOINT_NAME, USE_RE_RESOLUTION_HOST));
Tests.awaitConnected(subscription);
Tests.awaitCounterDelta(countersReader, RESOLUTION_CHANGES.id(), initialResolutionChanges, 1);

subscription.close();

// wait for disconnect to ensure we stay in lock step
while (publication.isConnected())
{
Tests.sleep(10);
}

subscription = client.addSubscription(FIRST_SUBSCRIPTION_URI, STREAM_ID);

assertTrue(updateNameResolutionStatus(countersReader, ENDPOINT_NAME, USE_INITIAL_RESOLUTION_HOST));
Tests.awaitConnected(subscription);
Tests.awaitCounterDelta(countersReader, RESOLUTION_CHANGES.id(), initialResolutionChanges, 2);
}

@SlowTest
@Test
@InterruptAfter(20)
Expand Down
Loading