Page 1 of 1

"Session cannot be frozen" server-side error

Posted: 22 Jan 2012, 04:03
by ericheimburg
Hi, sometimes (unreliably, but > 25% of the time) when a client disconnects explicitly via SmartFoxServer.Disconnect() or the webpage hosting the content is closed abruptly, the server has an exception with the following message:

Code: Select all

20:02:48,640 WARN  [SocketReader] core.SocketReader     - Problems in SocketReader main loop: java.lang.IllegalStateException: Unexpected: Session cannot be frozen. { Id: 6, Type: DEFAULT, Logged: Yes, IP: 68.204.84.135:65504 }, Thread: Thread[SocketReader,5,main]
20:02:48,656 WARN  [SocketReader] core.SocketReader     -
java.lang.IllegalStateException: Unexpected: Session cannot be frozen. { Id: 6,Type: DEFAULT, Logged: Yes, IP: 68.204.84.135:65504 }
        com.smartfoxserver.bitswarm.sessions.DefaultReconnectionManager.addSession(DefaultReconnectionManager.java:175)
        com.smartfoxserver.bitswarm.sessions.DefaultReconnectionManager.onSessionLost(DefaultReconnectionManager.java:111)
        com.smartfoxserver.bitswarm.sessions.DefaultSessionManager.onSocketDisconnected(DefaultSessionManager.java:348)
        com.smartfoxserver.bitswarm.sessions.DefaultSessionManager.onSocketDisconnected(DefaultSessionManager.java:335)
        com.smartfoxserver.bitswarm.core.SocketReader.closeTcpConnection(SocketReader.java:349)
        com.smartfoxserver.bitswarm.core.SocketReader.readTcpData(SocketReader.java:318)
        com.smartfoxserver.bitswarm.core.SocketReader.readIncomingSocketData(SocketReader.java:228)
        com.smartfoxserver.bitswarm.core.SocketReader.run(SocketReader.java:172)
        java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        java.lang.Thread.run(Unknown Source)
This is using RC3 of the server and the RC3+ of the Unity client (the one released in the forums last month). However, the crash occurs when using the regular RC3 as well as the newer build.

This is a very serious issue because once it happens, the client remains in SFS2X's list of valid clients forever.

Can you give some insight into what is going on and/or a workaround?

Posted: 24 Jan 2012, 08:37
by Lapo
It is likely that this is related to a network issue on the client side, I would suspect that the problem could be caused by a browser/plugin crash which leaves the connection in an "unhealthy" state, in other words in CLOSE_WAIT mode.

I will ask Thomas Lund (the C# guru) to give it a closer look.