留言板

Stuck Thread on LDAP com.sun.jndi.ldap.Connection.run(Connection.java:860)

thumbnail
Matthieu Levesque,修改在6 年前。

Stuck Thread on LDAP com.sun.jndi.ldap.Connection.run(Connection.java:860)

Junior Member 帖子: 64 加入日期: 09-2-13 最近的帖子
Hi,

We updated our installation from EE 6.1.20 to EE 6.2 sp10 earlier this year. Our setup uses LDAP + CAS to authenticate our users. Lately we found 2 Threads stuck running 100% (visualising with jvisualvm), digging in the stack (using jstack) we found that theses thread were running com.sun.jndi.ldap.Connection.run. The 2 threads is probably because we have 2 types of users that we import into Liferay.

Here's the stack:

"Thread-436876" #441010 daemon prio=5 os_prio=0 tid=0x00007f1d18f2d000 nid=0x7054 runnable [0x00007f1c4d773000]
   java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:171)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
        - locked <0x00000005f977b510> (a java.io.BufferedInputStream)
        at com.sun.jndi.ldap.Connection.run(Connection.java:860)
        at java.lang.Thread.run(Thread.java:748)

"Thread-434214" #438278 daemon prio=5 os_prio=0 tid=0x00007f1d1404f800 nid=0x659c runnable [0x00007f1c4b124000]
   java.lang.Thread.State: RUNNABLE
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
        at java.net.SocketInputStream.read(SocketInputStream.java:171)
        at java.net.SocketInputStream.read(SocketInputStream.java:141)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
        - locked <0x00000005f9150de8> (a java.io.BufferedInputStream)
        at com.sun.jndi.ldap.Connection.run(Connection.java:860)
        at java.lang.Thread.run(Thread.java:748)


Now I found these issues that should have been resolved in our version:
https://issues.liferay.com/browse/LPE-7348
https://issues.liferay.com/browse/LPS-28638

Also I found that Java 1.7 had problems with Ldap (https://community.oracle.com/thread/2577767), we now have updated to Java 1.8 (1.8.0_141) bit this hasn't resolved the issue.

Our LDAP config passes trough a stunnel for the SSL encryption (for skipping the java keystore and added flexibility to change the provider on the fly). Right now every time I see those threads stuck, I can simply restart stunnel to force the threads to stop.

Now I'm considering disabling the connection pool for LDAP (ldap.connection.com.sun.jndi.ldap.connect.pool=false) to see if it might fix this.

Are others experiencing these thread locks?

If you did a some point, how did you manage to fix it?

Thanks,

Matt