transport: edit TransportConnectionListener for close exceptions (#129015)

The TransportConnectionListener interface has previously included the
Transport.Connection being closed and unregistered in its onNodeDisconnected
callback. This is not in use, and can be removed as it is also available in the
onConnectionClosed callback. It is being replaced with a Nullable exception that
caused the close. This is being used in pending work (ES-11448) to differentiate
network issues from node restarts.

Closes ES-12007
This commit is contained in:
Simon Chase 2025-06-05 15:20:08 -07:00 committed by GitHub
parent aceaf23130
commit ee716f11b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 42 additions and 23 deletions

View file

@ -202,7 +202,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
}
@Override
public void onNodeDisconnected(DiscoveryNode node, Transport.Connection connection) {
public void onNodeDisconnected(DiscoveryNode node, @Nullable Exception closeException) {
fail("disconnect should not be called " + node);
}
};
@ -924,7 +924,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
}
@Override
public void onNodeDisconnected(DiscoveryNode node, Transport.Connection connection) {
public void onNodeDisconnected(DiscoveryNode node, @Nullable Exception closeException) {
latch.countDown();
}
};
@ -2118,7 +2118,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
}
@Override
public void onNodeDisconnected(DiscoveryNode node, Transport.Connection connection) {
public void onNodeDisconnected(DiscoveryNode node, @Nullable Exception closeException) {
fail("disconnect should not be called " + node);
}
};