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

Emmanuel Lecharny commented on DIRAPI-200:
------------------------------------------

Having set the logs to DEBUG, I see that a NPE is occuring when we get the 
PoolableLdapConnectionFactory.destroyObject() method being called :

[07:05:05] DEBUG 
[org.apache.directory.ldap.client.api.PoolableLdapConnectionFactory] - 
Destroying org.apache.directory.ldap.client.api.LdapNetworkConnection@cd3fee8
[07:05:05] DEBUG [org.apache.directory.ldap.client.api.LdapNetworkConnection] - 
Sending Unbind request 
MessageType : UNBIND_REQUEST
Message ID : 2
    UnBind 
Requestorg.apache.directory.api.ldap.model.message.UnbindRequestImpl@ac95cf3c
[07:05:05] DEBUG [org.apache.directory.ldap.client.api.LdapNetworkConnection] - 
waiting for closeFuture
[07:05:05] DEBUG [org.apache.directory.ldap.client.api.LdapNetworkConnection] - 
received a NoD, closing everything
[07:05:05] DEBUG [org.apache.directory.ldap.client.api.LdapNetworkConnection] - 
closeFuture done
[07:05:05] DEBUG [org.apache.directory.ldap.client.api.LdapNetworkConnection] - 
Unbind successful


I suspect that we don't have anymore connection in the pool then. I'm 
investigating. 

> 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)

Reply via email to