Java LDAP Deadlock in JNDI Cleanup Operations (Doc ID 1486337.1)

Last updated on APRIL 09, 2017

Applies to:

Java Platform, Standard Edition - Version 6 to 7 [Release 6 to 7]
Information in this document applies to any platform.

Symptoms

Java encounters an LDAP deadlock in JNDI LDAP Connection cleanup operations after updating to Java SE 6 update 27.  The problem is seen intermittently on multiple platforms such as Windows 64-bit and Solaris 10 SPARC but only on heavy-duty hardware (e.g. 32 or more cores).  This issue causes all new user connection requests to fail because they cannot authenticate.

Examples of thread dumps:

1)

"Thread-7" tid=0x27 in BLOCKED
  Blocked: 4[-1ms], Waited: 967[-1ms]
  User CPU: 514ms
  at com.sun.jndi.ldap.Connection.cleanup(Connection.java:617)
  - waiting on (a com.sun.jndi.ldap.Connection), held by Thread-14244098
  at com.sun.jndi.ldap.LdapClient.forceClose(LdapClient.java:441)
  at com.sun.jndi.ldap.LdapClient.closeConnection(LdapClient.java:459)
  - locked (a com.sun.jndi.ldap.LdapClient)
  at com.sun.jndi.ldap.pool.ConnectionDesc.expire(ConnectionDesc.java:113)
  - locked (a com.sun.jndi.ldap.pool.ConnectionDesc)
  at com.sun.jndi.ldap.pool.Connections.expire(Connections.java:280)
  - locked (a com.sun.jndi.ldap.pool.Connections)
  at com.sun.jndi.ldap.pool.Pool.expire(Pool.java:153)
  - locked (a java.util.WeakHashMap)
  at com.sun.jndi.ldap.pool.PoolCleaner.run(PoolCleaner.java:44)
  - locked (a com.sun.jndi.ldap.pool.PoolCleaner)
  
  "Thread-14244098" tid=0xe1a983 in BLOCKED
  Blocked: 1[-1ms], Waited: 0[-1ms]
  User CPU: 0ns
  at
  com.sun.jndi.ldap.pool.Connections.removePooledConnection(Connections.java:247)
  - waiting on (a com.sun.jndi.ldap.pool.Connections), held by Thread-7
  at
  com.sun.jndi.ldap.LdapClient.processConnectionClosure(LdapClient.java:482)
  at com.sun.jndi.ldap.Connection.cleanup(Connection.java:659)
  - locked (a com.sun.jndi.ldap.Connection)
  at com.sun.jndi.ldap.Connection.run(Connection.java:959)
  at java.lang.Thread.run(Thread.java:662)

 

2)

[deadlocked thread] Thread-463:
------------------------------
Thread 'Thread-463' is waiting to acquire lock 'com.sun.jndi.ldap.pool.Connections@45969c7b' that is held by thread 'Thread-10'

Stack trace:
------------
com.sun.jndi.ldap.pool.Connections.removePooledConnection(Connections.java:247)
com.sun.jndi.ldap.LdapClient.processConnectionClosure(LdapClient.java:482)
com.sun.jndi.ldap.Connection.cleanup(Connection.java:659)
com.sun.jndi.ldap.Connection.run(Connection.java:959)
java.lang.Thread.run(Thread.java:662)

[deadlocked thread] Thread-10:
-----------------------------
Thread 'Thread-10' is waiting to acquire lock 'com.sun.jndi.ldap.Connection@22fb72ee' that is held by thread 'Thread-459'

Stack trace:
------------
com.sun.jndi.ldap.Connection.cleanup(Connection.java:617)
com.sun.jndi.ldap.LdapClient.forceClose(LdapClient.java:441)
com.sun.jndi.ldap.LdapClient.closeConnection(LdapClient.java:459)
com.sun.jndi.ldap.pool.ConnectionDesc.expire(ConnectionDesc.java:113)
com.sun.jndi.ldap.pool.Connections.expire(Connections.java:280)
com.sun.jndi.ldap.pool.Pool.expire(Pool.java:153)
com.sun.jndi.ldap.pool.PoolCleaner.run(PoolCleaner.java:44)

[deadlocked thread] Thread-459:
------------------------------
Thread 'Thread-459' is waiting to acquire lock 'com.sun.jndi.ldap.pool.Connections@45969c7b' that is held by thread 'Thread-10'

Stack trace:
------------
com.sun.jndi.ldap.pool.Connections.removePooledConnection(Connections.java:247)
com.sun.jndi.ldap.LdapClient.processConnectionClosure(LdapClient.java:482)
com.sun.jndi.ldap.Connection.cleanup(Connection.java:659)
com.sun.jndi.ldap.Connection.run(Connection.java:959)
java.lang.Thread.run(Thread.java:662)

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms