sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (JIRA)" <>
Subject [jira] [Commented] (SLING-8407) JobManagerImpl.findJobs should prevent traversal
Date Thu, 09 May 2019 12:18:00 GMT


Thomas Mueller commented on SLING-8407:


> I'm not sure if we really should go this way. It adds a dependency to some Oak version
which makes it impossible to use this implementation in older versions.

Yes, the "option(traversal fail)" is not yet supported in older Oak version (1.0, 1.2, 1.4).
I'm fine to add support for this there: this syntax would be supported, but ignored (which
is fine).

> But more important it sounds like a workaround to me, It seems because the health checks
start too early, 

Well, there is no other API I can think of to verify at what point exactly indexing is done.
So there is no way to ensure health checks don't start too early. If you have a better idea,
then please tell me.

> you want to add a workaround here and there. Why not fix the root problem?

In my view, the root cause of the problem is in fact that the queries, that require an index,
don't currently ensure that the index is available. So in fact we are fixing the root cause
here. See also the related Oak issue [OAK-5889|].

> JobManagerImpl.findJobs should prevent traversal
> ------------------------------------------------
>                 Key: SLING-8407
>                 URL:
>             Project: Sling
>          Issue Type: Improvement
>          Components: Event
>            Reporter: Thomas Mueller
>            Priority: Major
> The method [JobManagerImpl.findJobs|]
runs a JCR query to find all jobs for a topic.
> It is possible that such a query is running while the repository isn't initialized yet,
meaning while the index isn't available yet. What is happening in this case is that the query
is traversing all nodes below that path, triggering a warning that the query doesn't use an
index. It is sometimes happening when a health check is running before the repository is initialized
(ReplicationQueueHealthCheck and DistributionQueueHealthCheck).
> It doesn't make sense that the query traverses the nodes. It should use an index. If
the index isn't available yet, it should fail. Therefore, the query should use "option(traversal
fail)". That would result in an exception that can be caught.  I will log a related issue
to change the health checks to process this exception and return HEALTH_CHECK_ERROR for this

This message was sent by Atlassian JIRA

View raw message