Hi,

Am Montag, den 22.11.2010, 13:57 +0000 schrieb Ian Boston: 
> On 22 Nov 2010, at 13:27, Felix Meschberger wrote:
> 
> > 
> > This sounds wrong, though. Where is this happening ?
> > 
> > Looking at the code, the AuthorizableResourceProvider.getResource method
> > just returns null if a user/group of said name does not exist.
> > 
> > Regards
> > Felix
> 
> Yes,
> if the resource does not exist, (null) then 
> JcrResourceResolver.resolveInternal starts a search which used 
> getChildInternal on
> parent  = /system/userManager/user    
> childName = userID
> 
> JcrResourceResolver.getChildInternal
> If the child does not exist, the implementation gets the parent and iterates 
> through all children looking for an alias.
> 
> Hence looking at all items in the iterator, line 1101 in the code I am 
> looking at.
> 
> Since this functionality is needed and used for JcrResources, where the 
> number of child nodes is always acceptable, then its Ok. (well, strictly 
> speaking looping through items to do a search is never acceptable is the 
> number of items is unbounded, but I am turning a blind eye to that)
> 
> Its only a problem when the ResourceProvider has so many child nodes as to 
> make the scan take too long. 
> 
> The downside of this is, it causes all authorizable nodes to be loaded into 
> the shared item cache which requires a read lock for each one. Not a problem 
> if there are no writes  happening on other threads, but it will block and be 
> blocked if there are writes. That also evicts everything else out of the 
> cache, We cant do anything about that here, but we can, afaict avoid the 
> listChildren behaviour.
> 
> I have tried returning null to the listChildren and it looks like thats Ok, 
> but I haven't done extensive tests yet.

Oh, yeah ... You hit me ;-)

We should do better with respect to this alias stuff -- I don't
particularly like this but some of our customers do ...

We should probably find a solution to this problem, like making support
for the sling:alias property configurable (easier to implement) or using
some other mechanism to resolve the sling:alias stuff (like an internal
map of aliased nodes and their resolutions -- maybe not the best of all
solutions, though)...

Regards
Felix

> 
> Ian
> 
> 


Reply via email to