[jira] [Commented] (DIRAPI-342) Unbind breaks connection

2019-05-31 Thread Stefan Seelmann (JIRA)


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

Stefan Seelmann commented on DIRAPI-342:


Ok. And feel free to revert my previous change :)

> Unbind breaks connection
> 
>
> Key: DIRAPI-342
> URL: https://issues.apache.org/jira/browse/DIRAPI-342
> Project: Directory Client API
>  Issue Type: Bug
>Affects Versions: 2.0.0.AM2
>Reporter: Stefan Seelmann
>Priority: Major
> Fix For: 2.0.0.AM4, 2.0.0
>
> Attachments: latch.patch
>
>
> The DelegatedAuthIT/DelegatedAuthOverSslIT/DelegatedAuthOverTlsIT tests fail 
> randomly (I try to stabilize tests on Windows, but also happens on Jenkins). 
> They all do multiple bind() and unbind() on the same connection, it seems the 
> unbind() is the reason.
> A simple test to reproduce the problem (on Linux):
> {code}
> @Test
> public void testSimpleBindAndUnbindLoop() throws Exception
> {
> try ( LdapConnection connection = new LdapNetworkConnection( 
> Network.LOOPBACK_HOSTNAME,
> getLdapServer().getPort() ) )
> {
> for ( int i = 0; i < 1; i++ )
> {
> System.out.println( i );
> connection.bind( "uid=admin,ou=system", "secret" );
> assertTrue( connection.isAuthenticated() );
> connection.unBind();
> assertFalse( connection.isAuthenticated() );
> // Thread.sleep( 10L );
> }
> }
> }
> {code}
> Without the unbind() or when sleeping for 10ms it works fine.
> Otherwise I saw 3 different errors:
> {code}
> org.apache.directory.ldap.client.api.exception.InvalidConnectionException: 
> ERR_04108_INVALID_CONNECTION Cannot connect on the server, the connection is 
> invalid
>   at 
> org.apache.directory.ldap.client.api.LdapNetworkConnection.checkSession(LdapNetworkConnection.java:574)
>   at 
> org.apache.directory.ldap.client.api.LdapNetworkConnection.bindAsync(LdapNetworkConnection.java:1596)
>   at 
> org.apache.directory.ldap.client.api.LdapNetworkConnection.bind(LdapNetworkConnection.java:1488)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:134)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:118)
> {code}
> {code}
> org.apache.directory.api.ldap.model.exception.LdapException: 
> ERR_04169_RESPONSE_QUEUE_EMPTIED The response queue has been emptied, no 
> response was found.
>   at 
> org.apache.directory.ldap.client.api.LdapNetworkConnection.bind(LdapNetworkConnection.java:1534)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:134)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:118)
> Caused by: org.apache.directory.api.ldap.model.exception.LdapException: 
> ERR_04170_TIMEOUT_OCCURED TimeOut occurred
>   at 
> org.apache.directory.ldap.client.api.LdapNetworkConnection.bind(LdapNetworkConnection.java:1505)
> {code}
> {code}
> org.apache.directory.api.ldap.model.exception.LdapProtocolErrorException: 
> PROTOCOL_ERROR: The server will disconnect!
>   at 
> org.apache.directory.api.ldap.model.message.ResultCodeEnum.processResponse(ResultCodeEnum.java:2137)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:136)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:118)
>   at 
> org.apache.directory.shared.client.api.operations.bind.SimpleBindRequestTest.testSimpleBindAndUnbindLoop(SimpleBindRequestTest.java:664)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (DIRAPI-342) Unbind breaks connection

2019-05-31 Thread Emmanuel Lecharny (JIRA)


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

Emmanuel Lecharny commented on DIRAPI-342:
--

FTR, I'm working on a better patch, with a cleaned up {{unbind()}} method 
without all the code duplication we have with the {{sessionClosed()}} method. 
The logic will be that cleaning up a session will be done once and for all in 
the {{sessionClosed()}} method.

That will also require some fix in the {{bindAsync( SaslGssApiRequest request 
)}} method, as an exception can be caught and rethrown without closing the 
session.

Last, not least, the patch in progress will break the {{PasswordPolicy}} unit 
test as the {{checkBindSuccess}} and {{checkBindFailure}} methods are not 
correctly used (we create a user connection before calling them, and they 
create a second connection. Pretty lame !

More to come...

> Unbind breaks connection
> 
>
> Key: DIRAPI-342
> URL: https://issues.apache.org/jira/browse/DIRAPI-342
> Project: Directory Client API
>  Issue Type: Bug
>Affects Versions: 2.0.0.AM2
>Reporter: Stefan Seelmann
>Priority: Major
> Fix For: 2.0.0.AM4, 2.0.0
>
> Attachments: latch.patch
>
>
> The DelegatedAuthIT/DelegatedAuthOverSslIT/DelegatedAuthOverTlsIT tests fail 
> randomly (I try to stabilize tests on Windows, but also happens on Jenkins). 
> They all do multiple bind() and unbind() on the same connection, it seems the 
> unbind() is the reason.
> A simple test to reproduce the problem (on Linux):
> {code}
> @Test
> public void testSimpleBindAndUnbindLoop() throws Exception
> {
> try ( LdapConnection connection = new LdapNetworkConnection( 
> Network.LOOPBACK_HOSTNAME,
> getLdapServer().getPort() ) )
> {
> for ( int i = 0; i < 1; i++ )
> {
> System.out.println( i );
> connection.bind( "uid=admin,ou=system", "secret" );
> assertTrue( connection.isAuthenticated() );
> connection.unBind();
> assertFalse( connection.isAuthenticated() );
> // Thread.sleep( 10L );
> }
> }
> }
> {code}
> Without the unbind() or when sleeping for 10ms it works fine.
> Otherwise I saw 3 different errors:
> {code}
> org.apache.directory.ldap.client.api.exception.InvalidConnectionException: 
> ERR_04108_INVALID_CONNECTION Cannot connect on the server, the connection is 
> invalid
>   at 
> org.apache.directory.ldap.client.api.LdapNetworkConnection.checkSession(LdapNetworkConnection.java:574)
>   at 
> org.apache.directory.ldap.client.api.LdapNetworkConnection.bindAsync(LdapNetworkConnection.java:1596)
>   at 
> org.apache.directory.ldap.client.api.LdapNetworkConnection.bind(LdapNetworkConnection.java:1488)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:134)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:118)
> {code}
> {code}
> org.apache.directory.api.ldap.model.exception.LdapException: 
> ERR_04169_RESPONSE_QUEUE_EMPTIED The response queue has been emptied, no 
> response was found.
>   at 
> org.apache.directory.ldap.client.api.LdapNetworkConnection.bind(LdapNetworkConnection.java:1534)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:134)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:118)
> Caused by: org.apache.directory.api.ldap.model.exception.LdapException: 
> ERR_04170_TIMEOUT_OCCURED TimeOut occurred
>   at 
> org.apache.directory.ldap.client.api.LdapNetworkConnection.bind(LdapNetworkConnection.java:1505)
> {code}
> {code}
> org.apache.directory.api.ldap.model.exception.LdapProtocolErrorException: 
> PROTOCOL_ERROR: The server will disconnect!
>   at 
> org.apache.directory.api.ldap.model.message.ResultCodeEnum.processResponse(ResultCodeEnum.java:2137)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:136)
>   at 
> org.apache.directory.ldap.client.api.AbstractLdapConnection.bind(AbstractLdapConnection.java:118)
>   at 
> org.apache.directory.shared.client.api.operations.bind.SimpleBindRequestTest.testSimpleBindAndUnbindLoop(SimpleBindRequestTest.java:664)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)