[OPENAM-5312] Initialization of a ServiceSchemaManager may block retrieval of already cached instances Created: 14/Dec/14  Updated: 20/Nov/16  Resolved: 27/Jan/15

Status: Resolved
Project: OpenAM
Component/s: sms
Affects Version/s: 10.0.0, 11.0.0, 12.0.0
Fix Version/s: 10.0.3, 11.0.3, 12.0.1, 13.0.0

Type: Bug Priority: Major
Reporter: Peter Major [X] (Inactive) Assignee: Peter Major [X] (Inactive)
Resolution: Fixed Votes: 0
Labels: EDISON, release-notes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to OPENAM-6476 Initialization of a ServiceConfigImpl... Resolved
Sprint: Sprint 76 - Sustaining
Support Ticket IDs:

 Description   

The initialization of the ServiceSchemaManager is done in a synchronized block, however this can involve a blocking LDAP operation. Unfortunately the retrieval of cached ServiceSchemaManager instances are synchronizing on the very same lock, which can easily mean that a hanging SSM initialization (due to operation timeout for example) can have a negative impact on the whole system.

An example thread dump of such a behavior would be:

"catalina-exec-3357" daemon prio=10 tid=0x00007fb7604c1800 nid=0x1293 waiting for monitor entry [0x00007fb74d763000]
java.lang.Thread.State: BLOCKED (on object monitor)
at java.util.Collections$SynchronizedMap.get(Collections.java:2037)
- waiting to lock <0x00000006bceaa908> (a java.util.Collections$SynchronizedMap)
at com.sun.identity.sm.ServiceSchemaManagerImpl.getInstance(ServiceSchemaManagerImpl.java:600)
at com.sun.identity.sm.ServiceSchemaManager.<init>(ServiceSchemaManager.java:116)
at com.sun.identity.sm.ServiceSchemaManager.<init>(ServiceSchemaManager.java:80)
at com.sun.identity.authentication.service.AuthUtils.getAuthRevisionNumber(AuthUtils.java:1600)
at com.sun.identity.authentication.config.AMAuthenticationManager.getAllowedModuleNames(AMAuthenticationManager.java:557)
at com.sun.identity.authentication.service.LoginState.populateOrgProfile(LoginState.java:748)
at com.sun.identity.authentication.service.LoginState.createAuthContext(LoginState.java:1874)
at com.sun.identity.authentication.service.AuthUtils.getAuthContext(AuthUtils.java:280)
at com.sun.identity.authentication.service.AuthUtils.getAuthContext(AuthUtils.java:180)
at com.sun.identity.authentication.UI.LoginViewBean.forwardTo(LoginViewBean.java:413)


 Comments   
Comment by Peter Major [X] (Inactive) [ 27/Jan/15 ]

The synchronization in SSMI has been improved with R12220 R12222 R12223 and R12224

Generated at Fri Oct 23 23:43:42 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.