directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject About message response handling in the API
Date Thu, 04 Feb 2010 16:08:54 GMT
Hi guys,

I think we have a huge problem in the current ldap-api implementation. 
Currently, when we send a request, we cretae an associated Future in 
which we store a response queue we have created to store the response 
when it will arrive. So far, so good.

The problem is that we need to associate an incoming response to the 
Future it is targeting. To do so we have a FutureMap<int, Future>, and 
as every response has the same MessageId than the associated request, we 
can easily find which request a response is associated to.

So when we get a response, we extract its messageId, do a lookup in the 
futureMap and get back the Future, then we update the queue with the 
response. The client which is doing a future.get() will then get its 

Now, we could perfectly unbind, and rebind immediately. What happens ? 
The session is then closed, and all responses we are waiting for will be 
discarded. First big bug here : we don't cleanup the futureMap.

Another case : instead of unbinding, we send an abandon request. It 
seems that we clean up the futureMap.

Last, not least, we can re-bind. In this case, the connection is not 
reset, but we start with a new MessageId, starting at 1. And we have 
another bug here : we don't cleanup the futureMap.

So we have to check all those cases and fix them.

Emmanuel L├ęcharny

View raw message