forked from External/mage
* Session locking - Fixed some problems with the reentrant lock.
This commit is contained in:
parent
2af52cfd3a
commit
896793b93d
4 changed files with 92 additions and 47 deletions
|
|
@ -115,28 +115,26 @@ public class SessionManager {
|
|||
Session session = sessions.get(sessionId);
|
||||
if (session != null) {
|
||||
if (!reason.equals(DisconnectReason.AdminDisconnect)) {
|
||||
synchronized (session) {
|
||||
if (!sessions.containsKey(sessionId)) {
|
||||
// session was removed meanwhile by another thread so we can return
|
||||
return;
|
||||
}
|
||||
sessions.remove(sessionId);
|
||||
switch (reason) {
|
||||
case Disconnected:
|
||||
session.kill(reason);
|
||||
LogServiceImpl.instance.log(LogKeys.KEY_SESSION_KILLED, sessionId);
|
||||
break;
|
||||
case SessionExpired:
|
||||
session.kill(reason);
|
||||
LogServiceImpl.instance.log(LogKeys.KEY_SESSION_EXPIRED, sessionId);
|
||||
break;
|
||||
case LostConnection:
|
||||
session.userLostConnection();
|
||||
LogServiceImpl.instance.log(LogKeys.KEY_SESSION_DISCONNECTED, sessionId);
|
||||
break;
|
||||
default:
|
||||
logger.error("endSession: unexpected reason " + reason.toString() + " - sessionId: "+ sessionId);
|
||||
}
|
||||
if (!sessions.containsKey(sessionId)) {
|
||||
// session was removed meanwhile by another thread so we can return
|
||||
return;
|
||||
}
|
||||
sessions.remove(sessionId);
|
||||
switch (reason) {
|
||||
case Disconnected:
|
||||
session.kill(reason);
|
||||
LogServiceImpl.instance.log(LogKeys.KEY_SESSION_KILLED, sessionId);
|
||||
break;
|
||||
case SessionExpired:
|
||||
session.kill(reason);
|
||||
LogServiceImpl.instance.log(LogKeys.KEY_SESSION_EXPIRED, sessionId);
|
||||
break;
|
||||
case LostConnection:
|
||||
session.userLostConnection();
|
||||
LogServiceImpl.instance.log(LogKeys.KEY_SESSION_DISCONNECTED, sessionId);
|
||||
break;
|
||||
default:
|
||||
logger.error("endSession: unexpected reason " + reason.toString() + " - sessionId: "+ sessionId);
|
||||
}
|
||||
} else {
|
||||
sessions.remove(sessionId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue