You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Stefan Egli (JIRA)" <ji...@apache.org> on 2018/05/14 15:07:00 UTC

[jira] [Updated] (OAK-7495) async,sync index not synchronous

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

Stefan Egli updated OAK-7495:
-----------------------------
    Description: 
On an oak 1.6.1 (AEM 6.3) a suspicious behaviour was detected, where in Sling an [addJob|https://github.com/apache/sling-old-svn-mirror/blob/org.apache.sling.event-4.2.0/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java#L286] followed by a [getJobById|https://github.com/apache/sling-old-svn-mirror/blob/org.apache.sling.event-4.2.0/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java#L294] (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.

Attached:
*  [^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"

/cc [~catholicon]

  was:
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.

Attached:
*  [^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"

/cc [~catholicon]


> async,sync index not synchronous
> --------------------------------
>
>                 Key: OAK-7495
>                 URL: https://issues.apache.org/jira/browse/OAK-7495
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: indexing
>    Affects Versions: 1.6.1
>            Reporter: Stefan Egli
>            Assignee: Vikas Saurabh
>            Priority: Major
>         Attachments: GetJobVerifier.java, slingeventJob.-1.tidy.json
>
>
> On an oak 1.6.1 (AEM 6.3) a suspicious behaviour was detected, where in Sling an [addJob|https://github.com/apache/sling-old-svn-mirror/blob/org.apache.sling.event-4.2.0/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java#L286] followed by a [getJobById|https://github.com/apache/sling-old-svn-mirror/blob/org.apache.sling.event-4.2.0/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java#L294] (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.
> Attached:
> *  [^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"
> /cc [~catholicon]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)