[ 
https://issues.apache.org/jira/browse/SLING-2493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Klimetschek updated SLING-2493:
-----------------------------------------

    Description: 
MapEntries [0] does first a scan in doInit() and then registers the event 
listener for sling:vanityPath nodes. Now if a observation event comes in 
between that, it gets lost - the old content was read in the initial scan and 
is cached.

It looks like we had such a case while both bundle and content were updated "at 
the same time". Possibly the registerService() method could be blocked for a 
while if many other services are restarted in such a update scenario involving 
multiple bundles.

I think the observation listener for such cases should always be registered 
*before* the initial scan.

[0] 
http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java

  was:
MapEntries [0] does first a scan in doInit() and then starts a thread for 
getting observation changes for sling:vanityPath nodes. Now if a observation 
event comes in between that, it gets lost - the old content was read in the 
initial scan and is cached. It looks like we had such a case while both bundle 
and content were updated "at the same time".

I think the observation listener for such cases should always be registered 
*before* the initial scan.

[0] 
http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java

    
> sling:vanityPaths: observation listener should be started before initial scan 
> on bundle activation to avoid missing changes
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-2493
>                 URL: https://issues.apache.org/jira/browse/SLING-2493
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Resource 2.1.0
>            Reporter: Alexander Klimetschek
>            Priority: Minor
>
> MapEntries [0] does first a scan in doInit() and then registers the event 
> listener for sling:vanityPath nodes. Now if a observation event comes in 
> between that, it gets lost - the old content was read in the initial scan and 
> is cached.
> It looks like we had such a case while both bundle and content were updated 
> "at the same time". Possibly the registerService() method could be blocked 
> for a while if many other services are restarted in such a update scenario 
> involving multiple bundles.
> I think the observation listener for such cases should always be registered 
> *before* the initial scan.
> [0] 
> http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to