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

Alexander Schwartz commented on DIRSERVER-2369:
-----------------------------------------------

Thanks [~elecharny] for commenting on this. Looking at this problem again, I 
see that I was led astray by an error message in our code. 

I was analyzing a (probable) race condition where a cleanup of some LDAP roles 
in tests fail in. After changing this to keepalive connections, I first thought 
it wouldn't happen any more, after further tests I see just happens less often 
(once in about 150 times)

I still don't know why this fails. The log shows (once in about 150 times) the 
message 

 

{{Caused by: javax.naming.NamingException: [LDAP: error code 1 - 
OPERATIONS_ERROR: failed for MessageType : SEARCH_REQUEST}}
{{Message ID : 2}}
{{SearchRequest}}
{{baseDn : 'cn=non-returned-role-4,ou=RealmRoles,dc=keycloak,dc=org'}}
{{filter : '(objectClass=*)'}}
{{scope : single level}}
{{typesOnly : false}}
{{Size Limit : no limit}}
{{Time Limit : no limit}}
{{Deref Aliases : deref Always}}
{{attributes :}}
{{org.apache.directory.api.ldap.model.message.SearchRequestImpl@cfe6acb0 
ManageDsaITImpl Control}}
{{Type OID : '2.16.840.1.113730.3.4.2'}}
{{Criticality : 'false'}}
{{'}}

 

Then the next test complains that the role exists. 

 

As there were a log of the other "UNBIND_REQUEST" messages above, I assumed 
they would be the cause.

 

It is probably correct to close this issue, although I still need to figure out 
what the cause is.

 

 

 

 

> ignoring message received from null session
> -------------------------------------------
>
>                 Key: DIRSERVER-2369
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-2369
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 2.0.0.AM26
>            Reporter: Alexander Schwartz
>            Priority: Major
>
> In a test setup we regularly saw the warning that an unbind request wasn't 
> processed (see log snippet below). This lead to errors later in our test, as 
> it assumed that the unbind would have been successful. 
> Looking at the comment in the code of LdapRequestHandler, it reads: "in some 
> cases the session is becoming null though the client is sending the 
> UnbindRequest before closing".
> Our workaround attempt is now to enable Java's LDAP connection pooling so 
> that we don't close the LDAP session right after sending the unbind request. 
> Ideally we would like to see the unbind request being processes regardless of 
> the closed session, as the caller doesn't really have means to determine if 
> the asynchronous processing has completed.
> It would be great if ApacheDS would handle this case.
>  
> The workaround for Java LDAP connection pooling:
>  * com.sun.jndi.ldap.connect.pool set to true to enable connection pooling
>  * com.sun.jndi.ldap.connect.pool.maxsize set to the same value  as 
> com.sun.jndi.ldap.connect.pool.prefsize to avoid short-lived connections
>  
> The log:
> {{11:05:56,830 INFO 
> [org.apache.directory.server.ldap.handlers.LdapRequestHandler] 
> (pool-26-thread-1) ignoring the message MessageType : UNBIND_REQUEST}}
> {{Message ID : 3}}
> {{UnBind 
> Requestorg.apache.directory.api.ldap.model.message.UnbindRequestImpl@cffb7dca 
> ManageDsaITImpl Control}}
> {{Type OID : '2.16.840.1.113730.3.4.2'}}
> {{Criticality : 'false'}}
> {{'}}
> {{received from null session}}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to