Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-debug-dev] Jetty 9 org.eclipse.jetty.websocket.common.WebSocketSession.disconnect() bug

++


On Wed, Jun 11, 2014 at 5:14 PM, dhiraj prajapati <dhirajpraj@xxxxxxxxx> wrote:
++


On Wed, Jun 11, 2014 at 3:51 PM, dhiraj prajapati <dhirajpraj@xxxxxxxxx> wrote:
Hi,
I am using jetty 9 websocket api for my application. One thing that i noticed is that when the websocket session is disconnected by closing the client browser window or by invoking org.eclipse.jetty.websocket.common.WebSocketSession.disconnect() does not remove the entry of that session from the set of open sessions maintained by org.eclipse.jetty.websocket.server.WebSocketServerFactory. (This cleanup is however done on invoking org.eclipse.jetty.websocket.common.WebSocketSession.close() ).
Hence, my application goes out of memory once there are too many opensessions in the set maintained by WebSocketServerFactory because many users prefer to abruptly close the browser window. As a work around to fix it in my application, I explicitly call WebSocketSession.close() in my method which handles @OnWebSocketClose.
I think this is a bug as  opensessions cleanup should be done on WebSocketSession.disconnect() as well, because the session is anyways not open ( isOpen() returns false ) when disconnect() is invoked.

Regards,
Dhiraj



Back to the top