[java-identity-provider COMMIT] /trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSe...

noreply at shibboleth.net noreply at shibboleth.net
Wed Feb 10 19:33:48 EST 2016


Author: scantor
Date: Wed Feb 10 19:33:48 2016
New Revision: 8089

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8089&view=rev
Log:
IDP-920 - Secondary session index update fails when a fixed NameID is used

https://issues.shibboleth.net/jira/browse/IDP-920

Modified:
    trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java

Modified: trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java?rev=8089&r1=8088&r2=8089&view=diff
==============================================================================
--- trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java	(original)
+++ trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java	Wed Feb 10 19:33:48 2016
@@ -668,14 +668,19 @@
             }
 
             try {
-                if (sessionList != null && !sessionList.getValue().contains(idpSession.getId() + ',')) {
-                    // Need to update record.
-                    String updated = sessionList.getValue() + idpSession.getId() + ',';
-                    if (storageService.updateWithVersion(sessionList.getVersion(), serviceId, serviceKey, updated,
-                            Math.max(sessionList.getExpiration(), 
-                                     spSession.getExpirationInstant() + sessionSlop)) == null) {
-                        log.debug("Secondary index record disappeared, retrying as insert");
-                        indexBySPSession(idpSession, spSession, attempts - 1);
+                if (sessionList != null) {
+                    if (!sessionList.getValue().contains(idpSession.getId() + ',')) {
+                        // Need to update record.
+                        String updated = sessionList.getValue() + idpSession.getId() + ',';
+                        if (storageService.updateWithVersion(sessionList.getVersion(), serviceId, serviceKey, updated,
+                                Math.max(sessionList.getExpiration(), 
+                                         spSession.getExpirationInstant() + sessionSlop)) == null) {
+                            log.debug("Secondary index record disappeared, retrying as insert");
+                            indexBySPSession(idpSession, spSession, attempts - 1);
+                        }
+                    } else {
+                        log.debug("IdP session {} already indexed against service ID {} and key {}", idpSession.getId(),
+                                serviceId, serviceKey);
                     }
                 } else if (!storageService.create(serviceId, serviceKey, idpSession.getId() + ',',
                         spSession.getExpirationInstant() + sessionSlop)) {



More information about the commits mailing list