Page 1 of 1

forceLogout / forceLogin called twice

Posted: 22 Aug 2011, 15:11
by lomriilod
Hi,
we are using the force login setting within our zone. Most of the times a user is disconnected by this feature, we recieve an error like this one:

Code: Select all

14:11:51,289 INFO  [pool-1-thread-1] entities.SFSZone     - User already logged in. Disconnecting previous instance : ( User Name: xxxxx, Id: 8001, Priv: 0, Sess: yyyy:56527 ) 
14:11:51,289 INFO  [pool-1-thread-1] sessions.DefaultSessionManager     - Session removed: { Id: 8432, Type: DEFAULT, Logged: Yes, IP: yyyy:56527 }
14:11:51,289 INFO  [SocketReader] sessions.DefaultSessionManager     - Session removed: { Id: 8432, Type: DEFAULT, Logged: Yes, IP: yyyy:56527 }
14:11:51,289 INFO  [pool-1-thread-1] entities.SFSZone     - User: xxxx was disconnected.
14:11:51,289 WARN  [SocketReader] core.SocketReader     - Problems in SocketReader main loop: com.smartfoxserver.v2.exceptions.SFSRuntimeException: Can't remove user: ( User Name: xxxx, Id: 8001, Priv: 0, Sess: yyyy:56527 ) , from: [ Room: L, Id: 0, Group: L, isGame: false ], Thread: Thread[SocketReader,5,main]
14:11:51,290 WARN  [SocketReader] core.SocketReader     - 
com.smartfoxserver.v2.exceptions.SFSRuntimeException: Can't remove user: ( User Name: xxxx, Id: 8001, Priv: 0, Sess: yyyy:56527 ) , from: [ Room: L, Id: 0, Group: L, isGame: false ]
	com.smartfoxserver.v2.entities.managers.SFSRoomManager.removeUser(SFSRoomManager.java:442)
	com.smartfoxserver.v2.entities.managers.SFSRoomManager.removeUser(SFSRoomManager.java:427)
	com.smartfoxserver.v2.entities.SFSZone.removeUser(SFSZone.java:1154)
	com.smartfoxserver.v2.api.SFSApi.disconnectUser(SFSApi.java:246)
	com.smartfoxserver.v2.api.SFSApi.disconnect(SFSApi.java:175)
	com.smartfoxserver.v2.SmartFoxServer.onSessionClosed(SmartFoxServer.java:827)
	com.smartfoxserver.v2.SmartFoxServer.access$1(SmartFoxServer.java:825)
	com.smartfoxserver.v2.SmartFoxServer$BitSwarmEventListener.handleEvent(SmartFoxServer.java:894)
	com.smartfoxserver.bitswarm.service.BaseCoreService.dispatchEvent(BaseCoreService.java:110)
	com.smartfoxserver.bitswarm.sessions.DefaultSessionManager.dispatchLostSessionEvent(DefaultSessionManager.java:762)
	com.smartfoxserver.bitswarm.sessions.DefaultSessionManager.onSocketDisconnected(DefaultSessionManager.java:356)
	com.smartfoxserver.bitswarm.sessions.DefaultSessionManager.onSocketDisconnected(DefaultSessionManager.java:335)
	com.smartfoxserver.bitswarm.core.SocketReader.closeTcpConnection(SocketReader.java:349)
	com.smartfoxserver.bitswarm.core.SocketReader.readIncomingSocketData(SocketReader.java:234)
	com.smartfoxserver.bitswarm.core.SocketReader.run(SocketReader.java:172)
	java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	java.lang.Thread.run(Thread.java:662)

14:11:51,290 INFO  [pool-1-thread-1] api.SFSApi     - User disconnected: ( User Name: xxxx, Id: 8001, Priv: 0, Sess: yyyy:56527 ) 
14:11:51,291 INFO  [pool-1-thread-1] api.SFSApi     - Login in, { Zone: Pool }, ( User Name: xxxx, Id: 8162, Priv: 0, Sess: yyyy:56615 ) 
This looks like two threads doing the same task. The second one fails to remove the user, because the first one allready has done so. Is it possible, that the SessionCleaner trys to close the session at the same time, the SFSZone calls apply force login?

Posted: 22 Aug 2011, 15:29
by jamalsoueidan
Force login?

Posted: 22 Aug 2011, 16:01
by Lapo
I've never seen this before, looks weird at first but the thread is always the same (SocketReader-1). Nothing to worry about I would say.
If it happens regularly would be worth investigating.

Posted: 22 Aug 2011, 16:11
by lomriilod

Code: Select all

4:11:51,289 INFO  [pool-1-thread-1] sessions.DefaultSessionManager     - Session removed: { Id: 8432, Type: DEFAULT, Logged: Yes, IP: yyyy:56527 }
14:11:51,289 INFO  [SocketReader] sessions.DefaultSessionManager     - Session removed: { Id: 8432, Type: DEFAULT, Logged: Yes, IP: yyyy:56527 } 
These are the same threads? [SocketReader] and [pool-1-thread-1]?