tandraschko commented on code in PR #705:
URL: https://github.com/apache/myfaces/pull/705#discussion_r1573723120


##########
impl/src/main/java/org/apache/myfaces/push/cdi/WebsocketScopeManager.java:
##########
@@ -161,26 +161,12 @@ public static class ViewScope extends AbstractUserScope 
implements Serializable
         @Inject private WebsocketScopeManager scopeManager;
         @Inject private WebsocketSessionManager sessionManager;
         
-        /*
-         * If the view is discarded, destroy the websocket sessions associated 
with the view because they are no
-         * longer valid
-         */
         @PreDestroy
         public void destroy()
         {
-            // destroy parent scope ("session")
-            SessionScope sessionScope = (SessionScope) 
scopeManager.getScope(SCOPE_SESSION, false);
-            if (sessionScope != null)
-            {
-                for (String token : tokens.keySet())
-                {
-                    sessionScope.destroyChannelToken(token);
-                }
-            }
-
             channelTokens.clear();
             tokens.clear();
-       }
+        }

Review Comment:
   i think we still need to talk about this because of this comment:
   
   > The reason to do this is the connections must follow the same rules the 
view has, so if a view is disposed, all related websocket sessions must be 
disposed too on the server, and in that way we can avoid memory leaks.
   
   i think we have to do some other mechanism here as basically its correct
   
   you said:
   
   > any channelToken from the parent sessionScope is destroyed, even if it is 
still in use
   
   shouldnt it only destroy it for the current view, which is now expired?
   `tokens.keySet()` are the tokens from the current view, not just all in the 
session
   
       
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@myfaces.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to