Netflix / dgs-framework

GraphQL for Java with Spring Boot made easy.
https://netflix.github.io/dgs
Apache License 2.0
3.03k stars 286 forks source link

bug: timer threads created in WebsocketGraphQLTransportWSProtocolHandler persist after session closes #1805

Closed mikefischetti closed 5 months ago

mikefischetti commented 5 months ago

Expected behavior

Timer threads cancel after session has been closed and removed from contexts

Actual behavior

Timer threads remain after sessions are closed, increasing the jvm thread count. Timer threads are being created here: https://github.com/Netflix/dgs-framework/blob/38f483fcac83d4932a34ad68d414d6a96b5e2d1b/graphql-dgs-subscriptions-websockets/src/main/kotlin/com/netflix/graphql/dgs/subscriptions/websockets/WebsocketGraphQLTransportWSProtocolHandler.kt#L81

Steps to reproduce

Open a ws connection and send a "connection_init" + "subscribe" message using graphql-transport-ws. A timer thread should have been created. Close the connection and the threads remain.

Screen Shot 2024-02-01 at 5 11 46 PM Screen Shot 2024-02-01 at 5 14 37 PM

mikefischetti commented 5 months ago

opened https://github.com/Netflix/dgs-framework/pull/1808