LDAP threads are not closing and resulting App Server going down.
Hello,
We deployed our web application on AIX box in WebLogic 8.1 SP5. We are using Sun DS 5.2 for authentication. Even though we disconnect the LDAP connections after authentication or authentication failure, the LDAP sockets are still hanging in the WebLogic process and consuming the file descriptors and resulting the server going down. Can any one has similar problem? Any help is greatly appreciated.
# 2
First, I guess those piled up stalled connection will blow your ldap server down, not app server down, since app server is client from the ldap view.
Second, when you disconnect ldap connection, you have to implicitly invoke close() to notify the server, like Context.close().
Third, if you have no control over the java program, you can config the ldap server to timeout those hanging connections. One way is to use proxy server to create different network group with a timeout setting.
# 3
Hi,
We are using Sun DS 5.2_Patch4, Build 2005.230.0410 for AIX 5.3.0.04.
I run kill -3 PID of weblogic to get javacore, and I see the following entries for eack socket that is hanged.
Threads that are struck ( @2000 of them)
1LKFLATMONDUMP Thread identifiers (as used in flat monitors):
2LKFLATMON ident 0x1F9 "LDAPConnThread-6707 ldap://111.111.111.111:389" (0x658CEFA0) ee 0x658CED80
2LKFLATMON ident 0x1F8 "LDAPConnThread-6655 ldap://111.111.111.111:389" (0x658CBA20) ee 0x658CB800
2LKFLATMON ident 0x1F6 "LDAPConnThread-6647 ldap://111.111.111.111:389" (0x658B05A0) ee 0x658B0380
2LKFLATMON ident 0x1F5 "LDAPConnThread-6629 ldap://111.111.111.111:389" (0x6560D220) ee 0x6560D000
2LKFLATMON ident 0x1C9 "LDAPConnThread-6609 ldap://111.111.111.111:389" (0x607BDC20) ee 0x607BDA00
corrosponding error for each thread.
3XHSTACKLINE at 0xD3199838 in NET_Recv
3XHSTACKLINE at 0xD31A9EB4 in Java_java_net_SocketInputStream_socketRead0
3XMTHREADINFO"LDAPConnThread-6655 ldap://10.125.64.144:389" (TID:0x301490F0, sys_thread_t:0x658CBA20, state:R, native ID:0x1F694)
prio=5
4XESTACKTRACE at java.net.SocketInputStream.socketRead0(Native Method)
4XESTACKTRACE at java.net.SocketInputStream.read(SocketInputStream.java(Compiled Code))
4XESTACKTRACE at java.io.BufferedInputStream.fill(BufferedInputStream.java(Compiled Code))
4XESTACKTRACE at java.io.BufferedInputStream.read(BufferedInputStream.java(Compiled Code))
4XESTACKTRACE at netscape.ldap.ber.stream.BERElement.getElement(BERElement.java(Compiled Code))
4XESTACKTRACE at netscape.ldap.LDAPConnThread.run(LDAPConnThread.java(Compiled Code))
4XESTACKTRACE at java.lang.Thread.run(Thread.java(Compiled Code))
3XHNATIVESTACKNative Stack
NU
# 4
Thanks for your quick response.
In fact, the LDAP server is not going down at all. All the connections to LDAP server are opening from the application running on WebLogic. so due to lack of resources, WebLogic is going down. I am getting "Too many open files", "Insufficient Memory",...All these problems are due to too many open connections to LDAP.
This is the piece of code I am using to connect and disconnect
try {
directoryserverconnection =
DSProfile.connect(s, s1);
userprofilebean =
createUserProfile(s, s1, directoryserverconnection);
try {
directoryserverconnection.disconnect();
} catch (WSLDAPException _ex) {
System.out.println( "Error disconnecting from LDAP: " + _ex.toString());
}
} catch (Exception _ex) {
try {
directoryserverconnection.disconnect();
} catch (WSLDAPException _e) {
System.out.println( "Error disconnecting from LDAP: " + _e.toString());
}
System.out.println( "Error in creating profile: " + _ex.toString());
}
return userprofilebean;
}
How can I configure LDAP server to timeout the connections? Any documentation?
Thanks