Adding/removing sessions from principals wasn't atomic. If one thread
removed the last session from a principal while another thread added a
new one, the addition could be lost.
Fixes gh-3189
@ -132,13 +132,18 @@ public class SessionRegistryImpl implements SessionRegistry,
@@ -132,13 +132,18 @@ public class SessionRegistryImpl implements SessionRegistry,
@ -157,12 +162,7 @@ public class SessionRegistryImpl implements SessionRegistry,
@@ -157,12 +162,7 @@ public class SessionRegistryImpl implements SessionRegistry,
@ -176,13 +176,15 @@ public class SessionRegistryImpl implements SessionRegistry,
@@ -176,13 +176,15 @@ public class SessionRegistryImpl implements SessionRegistry,
logger.debug("Removing principal "+info.getPrincipal()
+" from registry");
}
principals.remove(info.getPrincipal());
sessionsUsedByPrincipal=null;
}
if(logger.isTraceEnabled()){
logger.trace("Sessions used by '"+info.getPrincipal()+"' : "