[
https://issues.apache.org/jira/browse/SLING-4895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14647514#comment-14647514
]
Marius Petria commented on SLING-4895:
--------------------------------------
[~cziegeler] I'll try to understand the things a little better. Are duplicate
mappings a valid case? It appears to be so, because two amendment configs can
have different service.ranking and the reason for that it is probably to be
able to override a mapping providing a different username. Hence the identity
of a mapping is given by the serviceName and subServiceName, and this means the
current compareTo method of Mapping is wrong and should not take into account
the userName.
Compared to my version I think what you do with useCount and
unprocessedRegistrations was done by eliminating duplicates of Mappings using
sorted sets. The major difference is that in my version you could end up
registering a service concurrently and hence you need to unregister. So I think
doing something similar to what you do with a placeholder registration makes
sense. I will update my patch to behave similarly and let's decide then which
way to go :).
> Service registry should not be called from within synchronized block
> --------------------------------------------------------------------
>
> Key: SLING-4895
> URL: https://issues.apache.org/jira/browse/SLING-4895
> Project: Sling
> Issue Type: Bug
> Components: Extensions
> Affects Versions: Service User Mapper 1.2.0
> Reporter: Carsten Ziegeler
> Fix For: Service User Mapper 1.2.2
>
> Attachments: SLING-4895-alt.diff, SLING-4895.diff
>
>
> RIght now, if e.g. an amendment is added/removed/updated, all
> registration/unregistration is done in a "large" synchronized block. This
> should be avoided
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)