Attempt an orderly websocket close on displacement before a hard disconnect
This commit is contained in:
parent
bf1190696e
commit
c0756e9c60
|
@ -363,7 +363,13 @@ public class WebSocketConnection implements MessageAvailabilityListener, Displac
|
|||
public void handleDisplacement() {
|
||||
Metrics.counter(DISPLACEMENT_COUNTER_NAME, List.of(UserAgentTagUtil.getPlatformTag(client.getUserAgent()))).increment();
|
||||
|
||||
client.hardDisconnectQuietly();
|
||||
try {
|
||||
client.close(1000, "OK");
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Orderly close failed", e);
|
||||
|
||||
client.hardDisconnectQuietly();
|
||||
}
|
||||
}
|
||||
|
||||
private static class StoredMessageInfo {
|
||||
|
|
Loading…
Reference in New Issue