Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

fix: Memory leak when using reactive subscriptions with KeepAlive #642

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class ReactiveWebSocketSubscriptionSession extends DefaultSubscriptionSession {

private final WebSocketSession webSocketSession;
private boolean opened = true;

public ReactiveWebSocketSubscriptionSession(
GraphQLSubscriptionMapper mapper, WebSocketSession webSocketSession) {
Expand All @@ -17,7 +18,7 @@ public ReactiveWebSocketSubscriptionSession(

@Override
public boolean isOpen() {
return true;
return opened;
}

@Override
Expand All @@ -34,4 +35,10 @@ public String getId() {
public WebSocketSession unwrap() {
return webSocketSession;
}

@Override
public void close(final String reason) {
super.close(reason);
this.opened = false;
}
}