[
https://issues.apache.org/jira/browse/SLING-8946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17025955#comment-17025955
]
Dirk Rudolph edited comment on SLING-8946 at 1/29/20 3:13 PM:
--------------------------------------------------------------
>From you client exception I cannot help you to resolve this issue. Can you
>share details of the test(s) and the environment they are executed against?
>Can you maybe share what is happening on the environment during you wait time
>(any services restarting)?
{quote}Also as per the change update() is happening at activation which was not
the case earlier. Can you please suggest why is this required?
{quote}
That is right. Before update was not called on the handler. That caused also
that {{ProviderContext.EXCLUDED_PATHS_CHANGED}} was not communicated to the
ResourceProvider properly. The right behaviour is, that it is called when the
exclude paths change.
As suggested earlier [1] it might make sense to improve the current behaviour
as now the {{provider.update()}} is always called even if there is no overlap.
{quote}Also earlier updateProviderContext was called for the handler but now it
is being called for handlers.values().get(0) which is a different handler than
earlier. Is this correct?
{quote}
You are right the call of {{updateProviderContext}} is now placed differently
than before but from the execution flow it has been called on the first handler
in the list per path before as well. [2], [3]
[1]
https://issues.apache.org/jira/browse/SLING-8946?focusedCommentId=17001076&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17001076
[2]
[https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/master/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java#L179]
[3]
[https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/master/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java#L297]
was (Author: diru):
>From you client exception I cannot help you to resolve this issue. Can you
>share details of the test(s) and the environment they are executed against?
{quote}Also as per the change update() is happening at activation which was not
the case earlier. Can you please suggest why is this required?
{quote}
That is right. Before update was not called on the handler. That caused also
that {{ProviderContext.EXCLUDED_PATHS_CHANGED}} was not communicated to the
ResourceProvider properly. The right behaviour is, that it is called when the
exclude paths change.
As suggested earlier [1] it might make sense to improve the current behaviour
as now the {{provider.update()}} is always called even if there is no overlap.
{quote}Also earlier updateProviderContext was called for the handler but now it
is being called for handlers.values().get(0) which is a different handler than
earlier. Is this correct?
{quote}
You are right the call of {{updateProviderContext}} is now placed differently
than before but from the execution flow it has been called on the first handler
in the list per path before as well. [2], [3]
[1]
https://issues.apache.org/jira/browse/SLING-8946?focusedCommentId=17001076&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17001076
[2]
[https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/master/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java#L179]
[3]
[https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/master/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java#L297]
> Non-deterministic shadowing of resource observation
> ---------------------------------------------------
>
> Key: SLING-8946
> URL: https://issues.apache.org/jira/browse/SLING-8946
> Project: Sling
> Issue Type: Bug
> Components: ResourceResolver
> Affects Versions: Resource Resolver 1.5.34
> Reporter: Dirk Rudolph
> Assignee: Robert Munteanu
> Priority: Critical
> Fix For: Resource Resolver 1.6.10
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> The BasicObservationReporter implements shadowing of events being propagated
> per ResourceProvider instance [1]. Assuming we do have 2 ResourceProviders
> registered, where the one shadows the other like this:
> - RP A registered on /
> - RP B registered on /path
> then currently the excludes given to the BasicObservationReporter are
> different depending on either RP A or RP B gets registered first:
> - RP A before RP B => excludes are empty
> - RP B before RP A => excludes contain /path
> This is because only the newly registered RP gets its ProviderContext updated
> [2]
> Same applies if RP B is registered before RP A and gets unregistered. In that
> case the ObservationReporter of RP A stays untouched.
> [1]
> [https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/master/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObservationReporter.java#L102]
> [2]
> [https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/master/src/main/java/org/apache/sling/resourceresolver/impl/providers/ResourceProviderTracker.java#L358]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)