Skip to content

Commit

Permalink
Merge pull request #992 from berinhardt/websocket-leak-fix
Browse files Browse the repository at this point in the history
Only remove first time handshake failures
  • Loading branch information
mrniko authored Aug 8, 2024
2 parents 6981e0c + 9675e98 commit c4ca71e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,11 @@ private void closeClient(UUID sessionId, Channel channel) {
} catch (Throwable t) {
log.warn("Can't close channel for sessionId: {}", sessionId, t);
}
ClientHead clientHead = clientsBox.removeClient(sessionId);
clientHead.disconnect();
ClientHead clientHead = clientsBox.get(sessionId);
if (clientHead != null && clientHead.getNamespaces().isEmpty()) {
clientsBox.removeClient(sessionId);
clientHead.disconnect();
}
log.info("Client with sessionId: {} was disconnected", sessionId);
}

Expand Down

0 comments on commit c4ca71e

Please sign in to comment.