You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Egli (JIRA)" <ji...@apache.org> on 2014/02/25 11:44:19 UTC

[jira] [Assigned] (SLING-3406) Stale item exception when concurrent topology change events

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

Stefan Egli reassigned SLING-3406:
----------------------------------

    Assignee: Stefan Egli

> Stale item exception when concurrent topology change events
> -----------------------------------------------------------
>
>                 Key: SLING-3406
>                 URL: https://issues.apache.org/jira/browse/SLING-3406
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Discovery Impl 1.0.2
>            Reporter: Jörg Hoh
>            Assignee: Stefan Egli
>         Attachments: SLING-3406-stacktrace.txt
>
>
> In the VotingHandler there is the possibility of a race condition, which results in a StaleItemException of the repository.
> the synchronized method analyzeVotings is called with a resourceResolver as parameter; this resourceResolver is created in the non-sychronized method handleEvent.
> When 2 events occur within a short time, the second resourceResolver can get created while the commit of the first one has not yet been processed. Then the second resourceResolver cannot commit its change.
> A solution would be to do the equivalent of "session.refresh()" inside analyzeVotings first, so the repository session is synced. THe other option would be to create the session inside the anaylzeVotings method, so there won't be 2 open resourceResolvers/sessions at any time. Both approaches would prevent the exception.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)