Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-7495

async,sync index not synchronous

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.1
    • Fix Version/s: None
    • Component/s: indexing
    • Labels:


      On an oak 1.6.1 (AEM 6.3) a suspicious behaviour was detected, where in Sling an addJob followed by a getJobById (in a different thread though, but perhaps would also fail in same thread) was not seeing the job that was just created.

      To give a bit more background, in Sling getJobById results in a query. That query uses an index which is built using "async, sync". So the assumption is that the index is actually synchronous. But a test reproducing initially mentioned scenario showed the opposite.


      • GetJobVerifier.java a Sling job test case that has 2 threads: a thread that does addJob, adds the resulting jobId to a list (synchronized). and a second thread that reads the jobId off that list and does a getJobById. That getJobById should find the job, as it was just created (how else could you figure out the jobId) - but sometimes it FAILs (see system out FAIL)
      • slingeventJob.-1.tidy.json the index definition showing it is indeed "async, sync"

      PS: Example query that is executed: /jcr:root/var/eventing/jobs//element(*,slingevent:Job)[@slingevent:eventId = '2018/5/11/2/12/bca505d9-3044-4de9-9732-056ab1b6c513_5569']

      /cc Vikas Saurabh


        1. GetJobVerifier.java
          4 kB
          Stefan Egli
        2. OAK-7495.demo.patch
          13 kB
          Vikas Saurabh
        3. OAK-7495-add-logs.patch
          13 kB
          Vikas Saurabh
        4. OAK-7495-potential-fix.patch
          1 kB
          Vikas Saurabh
        5. OAK-7495-test.patch
          11 kB
          Vikas Saurabh
        6. slingeventJob.-1.tidy.json
          0.2 kB
          Stefan Egli
        7. unit-tests.log
          7 kB
          Vikas Saurabh



            • Assignee:
              catholicon Vikas Saurabh
              stefanegli Stefan Egli


              • Created:

                Issue deployment