Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-3406

Stale item exception when concurrent topology change events

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Discovery Impl 1.0.2
    • Discovery Impl 1.0.4
    • Extensions
    • None

    Description

      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.

      Attachments

        1. SLING-3406-stacktrace.txt
          3 kB
          Joerg Hoh

        Activity

          People

            stefanegli Stefan Egli
            joerghoh Joerg Hoh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: