directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject [PagedSearch] Cleanup strategy
Date Wed, 17 Dec 2008 10:46:44 GMT
Hi,

this is the last step to handle the paged search request : cleaning the 
remaining paged search when they are not used.

The problem is that a client can launch a paged search, get some few 
pages, and then stop requesting the remaining pages, without closing the 
request. Obviously, this is bad, bad, bad, but we won't be able to spank 
all the clients ;)

The created paged search context will then remain until the session is 
closed, keeping all the associated data (cursors, and such) in memory. 
Plus the client may launch more than one paged search request, leading 
to a quick OOM...

There are a few strategy we can implement to avoid such a problem :
1) first, we can limit the number of paged search request per session. I 
guess that a session with more than  5 or 10 opened paged search is very 
unlikely to occur. I suggest that we limit the number of opened paged 
searches to 5 atm (of course, this should be configurable), and 
unlimited for the administartor. When we reach this number, then the 
oldest paged search will be removed from the session.
2) we can also manage a timeout for the paged search. That mean a thread 
will be in charge of removing all the time-outed paged search across the 
sessions.
3) We can also wait until the session dies, and cleanup the associated 
paged search.

In any case, we must do something, as the cursors _have_ to be closed.

Does those 3 proposals make sense to you? Did I forgot something? Do you 
see a better strategy ?

Thanks !

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Mime
View raw message