From dev-return-96729-archive-asf-public=cust-asf.ponee.io@sling.apache.org Fri May 10 07:21:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 362FE180778 for ; Fri, 10 May 2019 09:21:02 +0200 (CEST) Received: (qmail 11934 invoked by uid 500); 10 May 2019 07:21:01 -0000 Mailing-List: contact dev-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list dev@sling.apache.org Received: (qmail 11899 invoked by uid 99); 10 May 2019 07:21:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 May 2019 07:21:01 +0000 Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 776E3E2B61 for ; Fri, 10 May 2019 07:21:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 32C9025815 for ; Fri, 10 May 2019 07:21:00 +0000 (UTC) Date: Fri, 10 May 2019 07:21:00 +0000 (UTC) From: "Thomas Mueller (JIRA)" To: dev@sling.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SLING-8407) JobManagerImpl.findJobs should prevent traversal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SLING-8407?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16836974#comment-16836974 ] Thomas Mueller commented on SLING-8407: --------------------------------------- There is at least one other place where the parameter is not encoded: topic. If I'm not mistaken, ISO9075.encode is used unnecessarily in many places to encode constant property names, while some property names are not encoded, e.g. {noformat} buf.append(propName); {noformat} getJobById doesn't escape the id and also swallows exceptions. > JobManagerImpl.findJobs should prevent traversal > ------------------------------------------------ > > Key: SLING-8407 > URL: https://issues.apache.org/jira/browse/SLING-8407 > Project: Sling > Issue Type: Improvement > Components: Event > Reporter: Thomas Mueller > Priority: Major > > The method [JobManagerImpl.findJobs|https://github.com/apache/sling-org-apache-sling-event/blob/master/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java#L373] 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 case. -- This message was sent by Atlassian JIRA (v7.6.3#76005)