Bug #46
Size Limited requests
| Status: | Closed | Start: | 18/08/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | % Done: | 100% |
||
| Category: | Core | Spent time: | 4.00 hours | |
| Target version: | 1.0 |
Description
When a request is done with a size limit, an exception is raised and so the results are never set.
A simple workaround would be to filter the results after the effective LDAP search (without size limit).
- pro: no usefulness AACL evalution;
- cons: the LDAP request can return many result; the request can always fail if the size limit is defined server-side.
A more correct solution would be to do handle effective size limit, see http://forum.springsource.org/showthread.php?t=27836
But after the AACL filtering, there could be not enough results, so maybe a page result search is necessary to allow to take back the search and retrieve the following entries.
A patch is incoming in the next days (weeks ?) for the workaround.
Associated revisions
Catch SizeLimitExceededExceptionWithPartialResults in entry repository and filter partial results (references #46)
Some refactoring for authz entries fitlerting (references #46)
Manage size limit exception in getAllChildren() and getDirectChildren() (references #46)
History
Updated by Raphael Ouazana over 1 year ago
- Status changed from New to Assigned
- Assigned to set to Sebastien Bahloul
- % Done changed from 0 to 10
Workaround committed in r112.
More work needed for a real fix, reassigning to Seb.
Updated by Sebastien Bahloul about 1 year ago
- Assigned to changed from Sebastien Bahloul to Raphael Ouazana
Reassigning
Updated by Clément OUDOT 5 months ago
- Target version set to 0.8
It seems the solution is to use a callback handler, like this:
http://static.springsource.org/spring-ldap/docs/1.2.0/api/spring-ldap/org/springframework/ldap/core/NameClassPairCallbackHandler.html
Updated by Raphael Ouazana 5 months ago
- Status changed from Assigned to Closed
- % Done changed from 10 to 100
Fixed in r142.
The API has been extended. Instead of throwing a Spring SizeLimitExceededException (runtime), a new SizeLimitExceededExceptionWithPartialResults is thrown, allowing to catch it and get some results :
try {
entries = search(...);
} catch (SizeLimitExceededExceptionWithPartialResults e) {
entries = e.getPartialResults();
}
Updated by Clément OUDOT 4 months ago
- Category set to Core
- Status changed from Closed to Assigned
- % Done changed from 100 to 90
Hi,
when using this new exception, I get non filtered entries (non filtered by the authorization stack). As a result, if I am below the sizeLimit, I only see authorized entries, and if I am above, I see the first returning entries, but all of them (not only the authorized entries).
Updated by Clément OUDOT 3 months ago
- Status changed from Assigned to Feedback
- % Done changed from 90 to 100
- Add a internal filter() method
- Catch SizeLimitExceededExceptionWithPartialResults exception, filter partial results and throw the exception
- Delete code that check client size limit locally to rely on LDAP directory error code
Now, our entry repository should manage correctly size limit, from client or server.
Set status to feedback to have code review from Raphaël.
Updated by Clément OUDOT 3 months ago
- getAllChildren
- getDirectChildren
Updated by Clément OUDOT 3 months ago
- Status changed from Feedback to Closed
Updated by Clément OUDOT 19 days ago
- Target version changed from 0.8 to 1.0