directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "lucas theisen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DIRAPI-200) unBind() followed by bind() on the same connection may throw an IllegalStateException
Date Fri, 07 Nov 2014 23:15:34 GMT

    [ https://issues.apache.org/jira/browse/DIRAPI-200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14202912#comment-14202912
] 

lucas theisen commented on DIRAPI-200:
--------------------------------------

Attempting the rebind again resulted in a different error this time, MUCH earlier:

{code}
Running org.apache.directory.shared.client.api.LdapConnectionPoolTest
Iteration # 0
Failure after 13 iterations
org.apache.directory.api.ldap.model.exception.LdapException: The response queue has been emptied,
no response was found.
        at org.apache.directory.ldap.client.api.LdapNetworkConnection.bind(LdapNetworkConnection.java:1157)
        at org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:127)
        at org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:112)
        at org.apache.directory.shared.client.api.LdapConnectionPoolTest.testRebindNoPool(LdapConnectionPoolTest.java:264)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.apache.directory.server.core.integ.FrameworkRunner.runChild(FrameworkRunner.java:379)
        at org.apache.directory.server.core.integ.FrameworkRunner.runChild(FrameworkRunner.java:56)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.apache.directory.server.core.integ.FrameworkRunner.run(FrameworkRunner.java:154)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: org.apache.directory.api.ldap.model.exception.LdapException: TimeOut occurred
        at org.apache.directory.ldap.client.api.LdapNetworkConnection.bind(LdapNetworkConnection.java:1129)
        ... 30 more
Time to create and use 10 000 connections = 10321
{code}

> unBind() followed by bind() on the same connection may throw an IllegalStateException
> -------------------------------------------------------------------------------------
>
>                 Key: DIRAPI-200
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-200
>             Project: Directory Client API
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M23
>            Reporter: lucas theisen
>
> Not sure if this even should be allowed but the fact that it can result in an exception
is disconcerting.  I added a test case to {{LdapConnectionPoolTest}} (with the {{unBind()}}
currently commented out) that can be used to reproduce this issue.
> The main question here, in my mind, is whether or not this should be allowed.  If not
allowed, we should immediately throw a more reasonable exception if any operation is attempted
on an {{LdapConnection}} that has had {{unBind()}} called on it.  Perhaps still an {{IllegalStateException}},
but maybe with a message stating _connection no longer valid after unBind()_.  More importantly,
this should happen every time, rather than just when the race condition bears its ugly face.
 For more discussion, see [this email chain|http://mail-archives.apache.org/mod_mbox/directory-dev/201407.mbox/%3CEE6ADC61AF2D71408E4FA7F9517DB7710A9C07E5%40IMCMBX03.MITRE.ORG%3E].



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message