directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Henne (JIRA) <>
Subject [jira] Commented: (DIRSERVER-586) Reliable hang of DS during query
Date Wed, 02 Aug 2006 16:39:15 GMT
    [ ] 
Jörg Henne commented on DIRSERVER-586:

I just investigated this issue a bit further. It is definitely a problem with the network
layer, but I could not yet figure out what is going on.

What I have found:

A hanging client thread looks like this:

Thread [Thread-10] (Suspended)
	waiting for: com.sun.jndi.ldap.LdapRequest  (id=37)
	java.lang.Object.wait(long) line: not available [native method]
	com.sun.jndi.ldap.Connection.readReply(com.sun.jndi.ldap.LdapRequest) line: 418
	com.sun.jndi.ldap.LdapClient.processReply(com.sun.jndi.ldap.LdapRequest, com.sun.jndi.ldap.LdapResult,
int) line: 857
	com.sun.jndi.ldap.LdapClient.add(com.sun.jndi.ldap.LdapEntry, javax.naming.ldap.Control[])
line: 1008
	com.sun.jndi.ldap.LdapCtx.c_bind(javax.naming.Name, java.lang.Object,,
com.sun.jndi.toolkit.ctx.Continuation) line: 375
java.lang.Object,, com.sun.jndi.toolkit.ctx.Continuation)
line: 277
java.lang.Object, line: 197
java.lang.Object, line: 186, java.lang.Object,
line: 158 line: 77 line: 93$0(
line: 83$ line: 41

There is a corresponding com.sun.jndi.ldap.Connection worker thread, that goes along with
it - in this case the following one:

Thread [Thread-17] (Suspended)
	owns:  (id=36), byte[], int, int, int) line:
not available [native method][], int, int) line: 129 line: 218[], int, int) line: 256[], int, int) line: 313 line: 780 [local variables unavailable] line: 595

This worker thread looks normal - it is only used for reading, never for writing.

When a hang occurs, it is due to a message gone missing. The message has been sent by com.sun.jndi.ldap.LdapClient,
prior to calling Connection.readReply().

I added some debugging output directly in org.apache.mina.transport.socket.nio.process(Set).
Thus I can see the excact port numbers for which data becomes available. 
What I learned, is that data never becomes available for the corresponding socket (except
for the initial bind call). After some more debugging I found that the channel has, for some
reason, gine missing from the SocketIoProcessor's Selector.

Well, and now the big question is, of couse: why does the channel vanish? Maybe this rings
a bell with you one of you?

> Reliable hang of DS during query
> --------------------------------
>                 Key: DIRSERVER-586
>                 URL:
>             Project: Directory ApacheDS
>          Issue Type: Bug
>         Environment: DS 0.9.3, Windows, JDK 1.5
>            Reporter: Jörg Henne
>         Assigned To: Alex Karasulu
>         Attachments:,
> When running the attached test, the directory server hangs after executing a slew of
operations when searching for objects.
> First of all, some background on the test case:
> The attached test case (in the form of an exported eclipse project) is, unfortunately,
based on quite a few classes. They are part of a project I am currently working on: an object
to ldap mapper with a similar approach as castor for XML or hibernate for RDBMS, albeit a
lot more modest in complexity (I'll, hopefully, one day be able to open-source it - for now
it is still much to immature). I have supplied all that stuff mainly for your reference.
> To run the test case, please make sure that the constant "URL" in LDAPDirectoryTest points
to a valid directory. The URL the context points to must exist. It will, however, subsequently
create lots of nodes below it.
> The hang seems to be related to some kind of deadlock, since it doesn't occur once the
whole test is run via a single context only. To achieve this, set the constant "ONE_CONTEXT"
to true (each LDAPDirectory uses its own set of contexts).
> If you have any problems running the test, please don't hesitate to contact me.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message