You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1404,29 +1403,27 @@ public CompletableFuture<Void> onConnectionClosing(Object handback)
1404
1403
returnCompletableFuture.completedFuture(null);
1405
1404
}
1406
1405
1407
-
Log.debug("Closing client session with address {} and streamID {} that does not have SM resume.", session.getAddress(), session.getStreamID());
1406
+
CompletableFuture<Void> result = CompletableFuture.runAsync(() -> Log.debug("Closing client session with address {} and streamID {} that does not have SM resume.", session.getAddress(), session.getStreamID()));
1408
1407
1409
-
try
1410
-
{
1411
-
if ((session.getPresence().isAvailable() || !session.wasAvailable()) && routingTable.hasClientRoute(session.getAddress()))
1412
-
{
1413
-
// Send an unavailable presence to the user's subscribers. This gives us a chance to send an
1414
-
// unavailable presence to the entities that the user sent directed presences
1415
-
finalPresencepresence = newPresence();
1416
-
presence.setType(Presence.Type.unavailable);
1417
-
presence.setFrom(session.getAddress());
1418
-
router.route(presence);
1419
-
}
1420
-
} finally {
1408
+
if ((session.getPresence().isAvailable() || !session.wasAvailable()) && routingTable.hasClientRoute(session.getAddress())) {
1409
+
// Send an unavailable presence to the user's subscribers. This gives us a chance to send an
1410
+
// unavailable presence to the entities that the user sent directed presences
1411
+
finalPresencepresence = newPresence();
1412
+
presence.setType(Presence.Type.unavailable);
1413
+
presence.setFrom(session.getAddress());
1414
+
1415
+
result = result.thenRunAsync(() -> router.route(presence));
1416
+
}
1417
+
1418
+
// In the completion stage remove the session (which means it'll be removed no matter if the previous stage had exceptions).
Log.info("No ConnectionManager available (server is likely shutting down). Skipping execution of close listener for incoming server session with address {} and streamID {}.", session.getAddress(), session.getStreamID());
1457
-
returnCompletableFuture.failedFuture(newIllegalStateException("No ConnectionManager available (server is likely shutting down)."));
1458
-
}
1449
+
CompletableFuture<Void> result = CompletableFuture.runAsync(() -> Log.debug("Closing incoming server session with address {} and streamID {}.", session.getAddress(), session.getStreamID()));
1459
1450
1460
1451
// Remove all the domains that were registered for this server session.
Log.info("No ConnectionManager available (server is likely shutting down). Skipping execution of close listener for outgoing server session with address {} and streamID {}.", session.getAddress(), session.getStreamID());
1494
-
returnCompletableFuture.failedFuture(newIllegalStateException("No ConnectionManager available (server is likely shutting down)."));
1495
-
}
1480
+
CompletableFuture<Void> result = CompletableFuture.runAsync(() -> Log.debug("Closing outgoing server session with address {} and streamID {}.", session.getAddress(), session.getStreamID()));
1496
1481
1497
1482
// Remove all the domains that were registered for this server session.
0 commit comments