Apache Directory Project - [jira] Commented: (DIRSERVER-586) Reliable hang of DS during query

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > August 2006 > [jira] Commented: (DIRSERVER-586) Reliable hang of DS during query





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [jira] Commented: (DIRSERVER-586) Reliable hang of DS during query
Jörg Henne (JIRA)

2006-08-02, 1:11 pm

[ http://issues.apache.org/jira/brows...=3Dcomments#ac=
tion_12425285 ]=20
=20
J=C3=B6rg Henne commented on DIRSERVER-586:
--------------------------------------

I just investigated this issue a bit further. It is definitely a problem wi=
th 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)
=09waiting for: com.sun.jndi.ldap.LdapRequest (id=3D37)
=09java.lang.Object.wait(long) line: not available [native method]
=09com.sun.jndi.ldap.Connection.readReply(com.sun.jndi.ldap.LdapRequest) li=
ne: 418
=09com.sun.jndi.ldap.LdapClient.processReply(com.sun.jndi.ldap.LdapRequest,=
com.sun.jndi.ldap.LdapResult, int) line: 857
=09com.sun.jndi.ldap.LdapClient.add(com.sun.jndi.ldap.LdapEntry, javax.nami=
ng.ldap.Control[]) line: 1008
=09com.sun.jndi.ldap.LdapCtx.c_bind(javax.naming.Name, java.lang.Object, ja=
vax.naming.directory.Attributes, com.sun.jndi.toolkit.ctx.Continuation) lin=
e: 375
=09com.sun.jndi.ldap.LdapCtx(com.sun.jndi.toolkit.ctx.ComponentDirContext).=
p_bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attribut=
es, com.sun.jndi.toolkit.ctx.Continuation) line: 277
=09com.sun.jndi.ldap.LdapCtx(com.sun.jndi.toolkit.ctx.PartialCompositeDirCo=
ntext).bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Att=
ributes) line: 197
=09com.sun.jndi.ldap.LdapCtx(com.sun.jndi.toolkit.ctx.PartialCompositeDirCo=
ntext).bind(java.lang.String, java.lang.Object, javax.naming.directory.Attr=
ibutes) line: 186
=09javax.naming.directory.InitialDirContext.bind(java.lang.String, java.lan=
g.Object, javax.naming.directory.Attributes) line: 158
=09com.levigo.tcat.test.directory.TestHang.create(java.lang.String) line: 7=
7
=09com.levigo.tcat.test.directory.TestHang.createAndDelete() line: 93
=09com.levigo.tcat.test.directory.TestHang.access$0(com.levigo.tcat.test.di=
rectory.TestHang) line: 83
=09com.levigo.tcat.test.directory.TestHang$MyRunner.run() line: 41

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

Thread [Thread-17] (Suspended)
=09owns: java.io.BufferedInputStream (id=3D36)
=09java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[], i=
nt, int, int) line: not available [native method]
=09java.net.SocketInputStream.read(byte[], int, int) line: 129
=09java.io.BufferedInputStream.fill() line: 218
=09java.io.BufferedInputStream.read1(byte[], int, int) line: 256
=09java.io.BufferedInputStream.read(byte[], int, int) line: 313
=09com.sun.jndi.ldap.Connection.run() line: 780 [local variables unavailabl=
e]
=09java.lang.Thread.run() line: 595

This worker thread looks normal - it is only used for reading, never for wr=
iting.

When a hang occurs, it is due to a message gone missing. The message has be=
en sent by com.sun.jndi.ldap.LdapClient, prior to calling Connection.readRe=
ply().

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 bec=
omes available.=20
What I learned, is that data never becomes available for the corresponding =
socket (except for the initial bind call). After some more debugging I foun=
d that the channel has, for some reason, gine missing from the SocketIoProc=
essor's Selector.

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

> Reliable hang of DS during query
> --------------------------------
>
> Key: DIRSERVER-586
> URL: http://issues.apache.org/jira/browse/DIRSERVER-586
> Project: Directory ApacheDS
> Issue Type: Bug
> Environment: DS 0.9.3, Windows, JDK 1.5
> Reporter: J=C3=B6rg Henne
> Assigned To: Alex Karasulu
> Attachments: bugreport.zip, TestHang.java
>
>
> When running the attached test, the directory server hangs after executin=

g 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, u=

nfortunately, 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 complexi=
ty (I'll, hopefully, one day be able to open-source it - for now it is stil=
l much to immature). I have supplied all that stuff mainly for your referen=
ce.
> To run the test case, please make sure that the constant "URL" in LDAPDir=

ectoryTest 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 o=

ccur 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 se=
t of contexts).
> If you have any problems running the test, please don't hesitate to conta=

ct me.

--=20
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: htt=
p://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com