You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Anshika Agarwal <an...@gmail.com> on 2016/09/13 08:17:22 UTC
Re: [Service Ranking] WebDAV Handlers are being managed in reverse
order of service ranking.
- users-subscribe@sling.apache.org
+ users@sling.apache.org
Thanks,
Anshika Agarwal
On Tue, Sep 13, 2016 at 1:25 PM, Anshika Agarwal <an...@gmail.com>
wrote:
> Hi,
>
> This is regarding a handler manager present in the following artifact :
>
> <groupId>org.apache.sling</groupId>
> <artifactId>org.apache.sling.jcr.webdav</artifactId>
> <version>2.3.4</version>
>
> The SlingHandlerManager.java returns to jackrabbit.server.io, the list of
> Handler implementations present against a Managed Type (IO, Delete, Copy,
> etc.). See [1]. This list of handlers are ordered in ascending order of
> their rankings and jackrabbit iterates through them to identify which one
> to call based on which first implementation is willing to handle the
> functionality. See [2]. So in effect, the lowest ranked service get the
> chance to process first.
>
> In contradiction, the sling documentation states that it should be that
> higher ranking is given preference over lower one. See [3]
>
> To me this looks like a bug in sling. Please confirm the same so that I
> can log a bug on sling.
> IMO instead of calling handlerServices.entrySet() to update entries in
> SlingHandlerManager, issuing handlerServices.descendingMap().entrySet() should
> do the trick. Please let me know if you see concerns in this fix. One that
> I see is that it will impact all the components relying on this handler
> manager since they would currently be assuming the ascending order to work
> correctly. Thoughts?
>
> I have seen a similar bug in a different context @ [4] so explicitly
> adding Felix Meschberger, Carsten Ziegeler, Bertrand Delacretaz for your
> inputs.
>
> --
> Thanks,
> Anshika Agarwal
>
> [1] : https://github.com/apache/sling/blob/trunk/bundles/jcr/
> webdav/src/main/java/org/apache/sling/jcr/webdav/impl/
> handler/SlingHandlerManager.java#L53
> [2] : https://github.com/apache/jackrabbit/blob/trunk/
> jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/io/
> IOManagerImpl.java#L101
> [3] : http://sling.apache.org/documentation/the-sling-engine/filters.html
> [4] : https://issues.apache.org/jira/browse/SLING-2920
>
>
--
Anshika Agarwal
Re: [Service Ranking] WebDAV Handlers are being managed in reverse
order of service ranking.
Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,
On Tue, Sep 13, 2016 at 10:17 AM, Anshika Agarwal
<an...@gmail.com> wrote:
>> ...the lowest ranked service get the chance to process first.
>> In contradiction, the sling documentation states that it should be that
>> higher ranking is given preference over lower one. See [3] ...
This is wrong indeed but let's not change the implementation, we
already have a similar case with filters IIRC which introduced
problematic backwards compatibility issues.
There's not set rule about the semantics of service ranking order at
the application level, we just need to have correct documentation.
Please create a jira ticket about fixing the docs, with your
explanation, so that things are consistent.
-Bertrand