From dev-return-104008-archive-asf-public=cust-asf.ponee.io@sling.apache.org Tue Feb 25 12:57:06 2020 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 86A1D1802C7 for ; Tue, 25 Feb 2020 13:57:06 +0100 (CET) Received: (qmail 79326 invoked by uid 500); 25 Feb 2020 12:57:05 -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 79185 invoked by uid 99); 25 Feb 2020 12:57:05 -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; Tue, 25 Feb 2020 12:57:05 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 81D0EE30CF for ; Tue, 25 Feb 2020 12:57:04 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 160E97808DA for ; Tue, 25 Feb 2020 12:57:02 +0000 (UTC) Date: Tue, 25 Feb 2020 12:57:02 +0000 (UTC) From: "Dirk Rudolph (Jira)" To: dev@sling.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SLING-8946) Non-deterministic shadowing of resource observation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SLING-8946?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1704= 4413#comment-17044413 ]=20 Dirk Rudolph commented on SLING-8946: ------------------------------------- For now implementing SLING-9077 seems the easiest to progress on this for n= ow. I tested the benchmark provided by [~sonagupt] with varying numbers of = ResourceProviders (100,200,400,800 and 1600) and compared the results of th= e test with and without my proposed changes for SLING-9077. In neither of b= oth cases the CPU time increases linear with the number of ResourceProvider= s unfortunately. Though with SLING-9077 the runtime of adding 1600 Resource= Providers compared to add only 100 ResourceProviders improves from *~80x* t= o *~5x* (based on median and assuming linear growth) [~sonagupt]=C2=A0can you test if you ITs complete when using the changes to= org.apache.sling.api bundle in SLING-9077?=C2=A0 I know this is not a proper solution (but maybe a sufficient one). For a pr= oper solution I think we would need to make the PathSet used for the exclud= e Paths mutable so that overlapping ResourceProvider's can be added/removed= as the RP actually appears/disappears. Now this sounds easier as it is but= especially in the BasicObservationReporter's constructor some optimisation= is applied when collecting the ObservationConfigurations. Also that would = mean that the JcrResourceProvider cannot register it's listeners on update(= ) with the excludePaths set anymore (not implemented anyway in Oak afaik). [~cziegeler] can you remember why BasicObservationReporter l101 ff [1] is n= ecessary? As far as I can see the condition on the providerPath should be q= uite restrictive already, for example: {quote}providerPath =3D / excludedPaths =3D [/libs/sling/Folder/s7publish.json.POST.servlet,/libs/sl= ing/distribution/services/agents,...]=20 info.paths =3D [/content,/var] {quote} Can you give an example what this code was supposed to handle? [1] [https://github.com/apache/sling-org-apache-sling-resourceresolver/blob= /master/src/main/java/org/apache/sling/resourceresolver/impl/observation/Ba= sicObservationReporter.java#L101] > Non-deterministic shadowing of resource observation > --------------------------------------------------- > > Key: SLING-8946 > URL: https://issues.apache.org/jira/browse/SLING-8946 > Project: Sling > Issue Type: Bug > Components: ResourceResolver > Affects Versions: Resource Resolver 1.5.34 > Reporter: Dirk Rudolph > Assignee: Robert Munteanu > Priority: Critical > Fix For: Resource Resolver 1.6.18 > > Attachments: PerformanceScript.sh > > Time Spent: 1.5h > Remaining Estimate: 0h > > The BasicObservationReporter implements shadowing of events being propaga= ted per ResourceProvider instance [1]. Assuming we do have 2 ResourceProvid= ers registered, where the one shadows the other like this: > - RP A registered on / > - RP B registered on /path > then currently the excludes given to the BasicObservationReporter are dif= ferent depending on either RP A or RP B gets registered first: > - RP A before RP B =3D> excludes are empty > - RP B before RP A =3D> excludes contain /path > This is because only the newly registered RP gets its ProviderContext upd= ated [2] > Same applies if RP B is registered before RP A and gets unregistered. In = that case the ObservationReporter of RP A stays untouched. > [1] [https://github.com/apache/sling-org-apache-sling-resourceresolver/bl= ob/master/src/main/java/org/apache/sling/resourceresolver/impl/observation/= BasicObservationReporter.java#L102] > [2] [https://github.com/apache/sling-org-apache-sling-resourceresolver/b= lob/master/src/main/java/org/apache/sling/resourceresolver/impl/providers/R= esourceProviderTracker.java#L358] -- This message was sent by Atlassian Jira (v8.3.4#803005)