@@ -245,8 +245,8 @@ class StreamEnvironment implements Environment {
245245 Runnable locatorInitSequence =
246246 () -> {
247247 RuntimeException lastException = null ;
248- for (int i = 0 ; i < addresses .size (); i ++) {
249- Address address = addresses .get (i );
248+ for (int i = 0 ; i < locators .size (); i ++) {
249+ Address address = addresses .get (i % addresses . size () );
250250 Locator locator = locator (i );
251251 address = addressResolver .resolve (address );
252252 String connectionName = connectionNamingStrategy .apply (ClientConnectionType .LOCATOR );
@@ -305,10 +305,10 @@ private ShutdownListener shutdownListener(
305305 Client .ShutdownListener shutdownListener =
306306 shutdownContext -> {
307307 if (shutdownContext .isShutdownUnexpected ()) {
308+ String label = locator .label ();
308309 locator .client (null );
309310 LOGGER .debug (
310- "Unexpected locator disconnection for locator on '{}', trying to reconnect" ,
311- locator .label ());
311+ "Unexpected locator disconnection for locator on '{}', trying to reconnect" , label );
312312 try {
313313 Client .ClientParameters newLocatorParameters =
314314 this .locatorParametersCopy ().shutdownListener (shutdownListenerReference .get ());
@@ -1006,7 +1006,9 @@ private String label() {
10061006 if (c == null ) {
10071007 return address .host () + ":" + address .port ();
10081008 } else {
1009- return c .getHost () + ":" + c .getPort ();
1009+ return String .format (
1010+ "%s:%d [advertised %s:%d]" ,
1011+ c .getHost (), c .getPort (), c .serverAdvertisedHost (), c .serverAdvertisedPort ());
10101012 }
10111013 }
10121014
0 commit comments