[GitHub] [sling-org-apache-sling-distribution-core] tmaret commented on pull request #44: SLING-8595 update to bundle-parent 40

2022-03-08 Thread GitBox


tmaret commented on pull request #44:
URL: 
https://github.com/apache/sling-org-apache-sling-distribution-core/pull/44#issuecomment-1062642111


   I forgot to submit my review earlier, sorry.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-distribution-core] tmaret commented on a change in pull request #44: SLING-8595 update to bundle-parent 40

2022-03-08 Thread GitBox


tmaret commented on a change in pull request #44:
URL: 
https://github.com/apache/sling-org-apache-sling-distribution-core/pull/44#discussion_r564944618



##
File path: 
src/main/java/org/apache/sling/distribution/agent/impl/ForwardDistributionAgentFactory.java
##
@@ -69,125 +59,136 @@
 import org.apache.sling.settings.SlingSettingsService;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.Designate;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+import org.osgi.service.metatype.annotations.Option;
+
+
+
 
 /**
  * An OSGi service factory for {@link DistributionAgent}s which references 
already existing OSGi services.
  */
-@Component(metatype = true,
-label = "Apache Sling Distribution Agent - Forward Agents Factory",
-description = "OSGi configuration factory for forward agents",
-configurationFactory = true,
-specVersion = "1.1",
-policy = ConfigurationPolicy.REQUIRE
+@Component(
+configurationPolicy = ConfigurationPolicy.REQUIRE,
+property= {"webconsole.configurationFactory.nameHint=Agent name: 
{name}"}

Review comment:
   An alternative to keep all props in the Config, is to define the 
webconsole.configurationFactory.nameHint like in 
   
   
https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/02846937fa0e07d183f50484bc68e028337c3fe5/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PublisherConfiguration.java#L28-L29

##
File path: 
src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionComponentProvider.java
##
@@ -40,24 +33,17 @@
 import 
org.apache.sling.distribution.queue.impl.DistributionQueueDispatchingStrategy;
 import 
org.apache.sling.distribution.transport.DistributionTransportSecretProvider;
 import org.apache.sling.distribution.trigger.DistributionTrigger;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
 
 /**
  * {@link DistributionComponentProvider} OSGi service.
  */
-@Component
-@Property(name = "name", value = "default")
-@References({
-@Reference(name = "distributionAgent", referenceInterface = 
DistributionAgent.class, cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, 
policy = ReferencePolicy.DYNAMIC),
-@Reference(name = "distributionPackageImporter", referenceInterface = 
DistributionPackageImporter.class, cardinality = 
ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC),
-@Reference(name = "distributionPackageExporter", referenceInterface = 
DistributionPackageExporter.class, cardinality = 
ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC),
-@Reference(name = "distributionQueueProvider", referenceInterface = 
DistributionQueueProvider.class, cardinality = 
ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC),
-@Reference(name = "distributionQueueDistributionStrategy", 
referenceInterface = DistributionQueueDispatchingStrategy.class, cardinality = 
ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC),
-@Reference(name = "distributionTransportSecretProvider", 
referenceInterface = DistributionTransportSecretProvider.class, cardinality = 
ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC),
-@Reference(name = "distributionTrigger", referenceInterface = 
DistributionTrigger.class, cardinality = 
ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC),
-@Reference(name = "distributionRequestAuthorizationStrategy", 
referenceInterface = DistributionRequestAuthorizationStrategy.class, 
cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = 
ReferencePolicy.DYNAMIC),
-@Reference(name = "distributionPackageBuilder", referenceInterface = 
DistributionPackageBuilder.class, cardinality = 
ReferenceCardinality.OPTIONAL_MULTIPLE, policy = ReferencePolicy.DYNAMIC)
+@Component ( property = {

Review comment:
   This must expose the `DistributionComponentProvider` service 

##
File path: 
src/main/java/org/apache/sling/distribution/component/impl/DefaultDistributionConfigurationManager.java
##
@@ -42,24 +43,27 @@
  

[jira] [Commented] (SLING-10051) Stabilize integration tests running on ci-builds

2022-03-08 Thread Robert Munteanu (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-10051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17503215#comment-17503215
 ] 

Robert Munteanu commented on SLING-10051:
-

[~olli] - the error you pasted does not really seem like an error. Maybe 
something printed on stderr that the failsafe plugin considers an error? See 
also https://issues.jenkins.io/browse/JENKINS-42484 .

> Stabilize integration tests running on ci-builds
> 
>
> Key: SLING-10051
> URL: https://issues.apache.org/jira/browse/SLING-10051
> Project: Sling
>  Issue Type: Improvement
>  Components: CI, Karaf
>Reporter: Oliver Lietz
>Assignee: Oliver Lietz
>Priority: Major
> Fix For: Karaf Launchpad Integration Tests (Oak Tar) 0.0.12, 
> Karaf Integration Tests 1.0.0
>
>
> Integration tests run fine on local system:
> {noformat}
> [INFO] 
> 
> [INFO] Reactor Summary:
> [INFO] 
> [INFO] Apache Sling - Karaf Configs 0.2.0-SNAPSHOT  SUCCESS [  4.496 
> s]
> [INFO] Apache Sling - Karaf Features 0.2.0-SNAPSHOT ... SUCCESS [  2.424 
> s]
> [INFO] Apache Sling - Karaf Distribution 0.2.0-SNAPSHOT ... SUCCESS [ 28.119 
> s]
> [INFO] Apache Sling - Karaf Integration Tests 0.2.0-SNAPSHOT SUCCESS [12:23 
> min]
> [INFO] Apache Sling - Karaf Launchpad Integration Tests (Oak Tar) 
> 0.0.1-SNAPSHOT SUCCESS [  01:13 h]
> [INFO] Apache Sling - Karaf Builder 1-SNAPSHOT  SUCCESS [ 11.308 
> s]
> [INFO] 
> 
> [INFO] BUILD SUCCESS
> [INFO] 
> 
> [INFO] Total time:  01:26 h
> [INFO] Finished at: 2021-01-10T14:31:57+01:00
> [INFO] 
> 
> {noformat}
> But unstable on ci-builds.apache.org:
> * 
> https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-karaf-integration-tests/job/master/
> * 
> https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-karaf-launchpad-oak-tar-integration-tests/job/master/



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (SLING-11168) Sling Starter 12: Unable to launch Composum

2022-03-08 Thread Robert Munteanu (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-11168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17503210#comment-17503210
 ] 

Robert Munteanu commented on SLING-11168:
-

[~jsedding] - would you be able to prepare a PR with your suggestion from 
https://issues.apache.org/jira/browse/SLING-11189?focusedCommentId=17502951&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17502951
 that [~sseifert] can test out? The proposed change should work and it might be 
enough to fix this particular bug in the Starter directly.

> Sling Starter 12: Unable to launch Composum
> ---
>
> Key: SLING-11168
> URL: https://issues.apache.org/jira/browse/SLING-11168
> Project: Sling
>  Issue Type: Bug
>  Components: Starter
>Affects Versions: Starter 12
>Reporter: Stefan Seifert
>Priority: Major
> Fix For: Starter 12
>
> Attachments: error.log, image-2022-03-01-17-47-08-965.png, 
> screenshot-1.png, starter-12-windows.log
>
>
> environment:
> * Windows 10
> * java 11.0.13 2021-10-19 LTS
> * Sling Starter: https://github.com/apache/sling-org-apache-sling-starter
> started sling starter 12 (or actually 13-SNAPSHOT from current master branch) 
> with:
> {noformat}
> mvn clean install
> java -jar target/dependency/org.apache.sling.feature.launcher.jar -f 
> target/slingfeature-tmp/feature-oak_tar.json
> {noformat}
> when trying to access composum via http://localhost:8080/bin/browser.html i 
> get the normal sling login (if not logged in already) and login as 
> admin/admin.
> directly after this i see a blink of composum, which is replaced immediately 
> with another composum login dialog:
> [^image-2022-03-01-17-47-08-965.png]
> [^error.log] from the instance



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[GitHub] [sling-org-apache-sling-distribution-core] sonarcloud[bot] removed a comment on pull request #44: SLING-8595 update to bundle-parent 40

2022-03-08 Thread GitBox


sonarcloud[bot] removed a comment on pull request #44:
URL: 
https://github.com/apache/sling-org-apache-sling-distribution-core/pull/44#issuecomment-1036080793


   SonarCloud Quality Gate failed.    ![Quality Gate 
failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png
 'Quality Gate failed')
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=BUG)
 
[![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png
 
'A')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=BUG)
  
   
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png
 
'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=VULNERABILITY)
 
[![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png
 
'B')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=VULNERABILITY)
 [1 
Vulnerability](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=VULNERABILITY)
  
   [![Security 
Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png
 'Security 
Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=SECURITY_HOTSPOT)
 
[![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png
 
'A')](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=SECURITY_HOTSPOT)
  
   [![Code 
Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png
 'Code 
Smell')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=CODE_SMELL)
 
[![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png
 
'A')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=CODE_SMELL)
 [88 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=CODE_SMELL)
   
   
[![11.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png
 
'11.6%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&metric=new_coverage&view=list)
 [11.6% 
Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&metric=new_coverage&view=list)
  
   
[![12.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png
 
'12.9%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&metric=new_duplicated_lines_density&view=list)
 [12.9% 
Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [sling-org-apache-sling-distribution-core] sonarcloud[bot] commented on pull request #44: SLING-8595 update to bundle-parent 40

2022-03-08 Thread GitBox


sonarcloud[bot] commented on pull request #44:
URL: 
https://github.com/apache/sling-org-apache-sling-distribution-core/pull/44#issuecomment-1061940402


   SonarCloud Quality Gate failed.    ![Quality Gate 
failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png
 'Quality Gate failed')
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=BUG)
 
[![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png
 
'A')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=BUG)
  
   
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png
 
'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=VULNERABILITY)
 
[![B](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/B-16px.png
 
'B')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=VULNERABILITY)
 [1 
Vulnerability](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=VULNERABILITY)
  
   [![Security 
Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png
 'Security 
Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=SECURITY_HOTSPOT)
 
[![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png
 
'A')](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=SECURITY_HOTSPOT)
  
   [![Code 
Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png
 'Code 
Smell')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=CODE_SMELL)
 
[![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png
 
'A')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=CODE_SMELL)
 [88 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&resolved=false&types=CODE_SMELL)
   
   
[![11.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png
 
'11.6%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&metric=new_coverage&view=list)
 [11.6% 
Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&metric=new_coverage&view=list)
  
   
[![12.9%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/20-16px.png
 
'12.9%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&metric=new_duplicated_lines_density&view=list)
 [12.9% 
Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-distribution-core&pullRequest=44&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[jira] [Updated] (SLING-8595) Update of sling parent pom

2022-03-08 Thread Christian Schneider (Jira)


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

Christian Schneider updated SLING-8595:
---
Fix Version/s: Content Distribution Journal Core 0.1.26

> Update of sling parent pom
> --
>
> Key: SLING-8595
> URL: https://issues.apache.org/jira/browse/SLING-8595
> Project: Sling
>  Issue Type: Sub-task
>  Components: Content Distribution
>Reporter: Christian Schneider
>Assignee: Christian Schneider
>Priority: Blocker
> Fix For: Content Distribution Journal Core 0.1.26
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> When running upstream modules together with sling distribution core in 
> eclipse I got issues as the outdated osgi core jar slipped into the build 
> dependencies of the upstream module.
> I found that updating the parent pom fixed the issue. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Reopened] (SLING-8595) Update of sling parent pom

2022-03-08 Thread Christian Schneider (Jira)


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

Christian Schneider reopened SLING-8595:


Reopening.. the change is not yet done

> Update of sling parent pom
> --
>
> Key: SLING-8595
> URL: https://issues.apache.org/jira/browse/SLING-8595
> Project: Sling
>  Issue Type: Sub-task
>  Components: Content Distribution
>Reporter: Christian Schneider
>Assignee: Christian Schneider
>Priority: Blocker
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> When running upstream modules together with sling distribution core in 
> eclipse I got issues as the outdated osgi core jar slipped into the build 
> dependencies of the upstream module.
> I found that updating the parent pom fixed the issue. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[VOTE] Release Release Apache Sling Content Distribution Core 0.5.0 and Content Distribution Journal 0.1.24

2022-03-08 Thread Christian Schneider
We solved these issues in this releases:

https://issues.apache.org/jira/projects/SLING/versions/12351110
https://issues.apache.org/jira/projects/SLING/versions/12351109

Staging repositories:
https://repository.apache.org/content/repositories/orgapachesling-2608/
https://repository.apache.org/content/repositories/orgapachesling-2609/

You can use this UNIX script to download the release and verify the
signatures:
https://gitbox.apache.org/repos/asf?p=sling-tooling-release.git;a=blob;f=check_staged_release.sh;hb=HEAD

Usage:
sh check_staged_release.sh [YOUR REPOSITORY ID] /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.--



Here is my +1 (non binding)

-- 
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com


[jira] [Updated] (SLING-10372) OSGi Installer: NPE during package installation during startup

2022-03-08 Thread Hans-Peter Stoerr (Jira)


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

Hans-Peter Stoerr updated SLING-10372:
--
Description: 
(As requested in SLING-10362) When starting a Sling Starter 12 with a feature 
archive containing a couple of packages and having a couple of packages 
installed with the Sling [fileinstaller 
provider|https://sling.apache.org/documentation/bundles/file-installer-provider.html],
 I often get a NPE, stacktrace is appended. This stops the installation of the 
package when this happens. It isn't about that particular package, though - if 
I take out other packages from the automatic installation or put it into the 
fileinstall directory it later, it installs happily.

It's a rather difficult to give detailed steps to reproduce that, but I have 
guess what's happening. I do have a particular setting where it always happens 
on my machine, but that might be sensitive to the speed of my machine and 
whatnot. Basically, I'm starting the feature launcher with a FAR containg 
several packages of ours, and also give the arguments

-Dsling.fileinstall.dir=launcher/fileinstall -Dfelix.startlevel.bundle=30

to the launcher, having placed several packages in the fileinstall directory. I 
guess the NPE happens only when enough packages are placed there, and it 
happens only on the first startup (i.e., there was no launcher directory yet).

I had a look around with the debugger: it seems the SlingRepository was stopped 
but not yet started again for a restart just before the PackageTransformer is 
trying to process the package, probably due to some kind of configuration 
change. It tries to access the repository via a reference of the 
OakSlingRepository whose manager already has been stopped so that 
getRepository() returns null. Hence the NPE. Probably the 
org.apache.sling.installer.factory.packages.impl.PackageTransformer should 
somehow handle such temporary failures that don't have anything to do with the 
package? Another way to solve seems to be to set the start level of the 
org.apache.sling.installer.factory.packages bundle to 21. Probably because when 
reaching the start level 20 so much happens at once, so that transition is not 
a good time to install packages.

Here is the stacktrace that marks the error. I'll attach a logfile for some 
more context. BTW: Interesting might be also the exceptions "Can't create child 
on a synthetic root" in the log file, which I receive regularily during 
startup, but that's probably not related to this problem, as it also happens 
when things work properly.
{code:java}
11.05.2021 13:27:49.462 *ERROR* [OsgiInstallerImpl] 
org.apache.sling.installer.factory.packages.impl.PackageTransformer Error while 
processing install content package task* of 
TaskResource(url=fileinstallff43091e0ee8ac91416c79636bdce5f4:/Users/hps/dev/composum/composum-launch/feature/composumstarter/target/launcher/fileinstall/99/composum-site-app-package-1.0.0-SNAPSHOT.zip,
 entity=content-package:tenants/ist:composum-site-app-package, state=INSTALL, 
attributes=[org.apache.sling.installer.api.tasks.ResourceTransformer=:27:23:1243:,
 package-id=tenants/ist:composum-site-app-package:1.0.0-SNAPSHOT, 
Bundle-Version=1.0.0.SNAPSHOT], digest=1620718306467) due to null, no retry.
 java.lang.NullPointerException: null
 at 
org.apache.sling.jcr.oak.server.internal.OakSlingRepository$2.run(OakSlingRepository.java:99)
 [org.apache.sling.jcr.oak.server:1.2.10]
 at 
org.apache.sling.jcr.oak.server.internal.OakSlingRepository$2.run(OakSlingRepository.java:96)
 [org.apache.sling.jcr.oak.server:1.2.10]
 at java.base/java.security.AccessController.doPrivileged(Native Method)
 at 
java.base/javax.security.auth.Subject.doAsPrivileged(Subject.java:550)
 at 
org.apache.sling.jcr.oak.server.internal.OakSlingRepository.createServiceSession(OakSlingRepository.java:96)
 [org.apache.sling.jcr.oak.server:1.2.10]
 at 
org.apache.sling.jcr.base.AbstractSlingRepository2.createServiceSession(AbstractSlingRepository2.java:166)
 [org.apache.sling.jcr.base:3.1.6]
 at 
org.apache.sling.jcr.base.AbstractSlingRepository2.loginService(AbstractSlingRepository2.java:383)
 [org.apache.sling.jcr.base:3.1.6]
 at 
org.apache.sling.installer.factory.packages.impl.PackageTransformer$AbstractPackageInstallTask.execute(PackageTransformer.java:263)
 [org.apache.sling.installer. factory.packages:1.0.4]
 at 
org.apache.sling.installer.core.impl.OsgiInstallerImpl.doExecuteTasks(OsgiInstallerImpl.java:918)
 [org.apache.sling.installer.core:3.11.4]
 at 
org.apache.sling.installer.core.impl.OsgiInstallerImpl.executeTasks(OsgiInstallerImpl.java:755)
 [org.apache.sling.installer.core:3.11.4]
 at 
org.apache.sling.installer.core.impl.OsgiInstallerImpl.run(OsgiInstallerImpl.java:304)
 [org.apache.sling.installer.core:3.11.4]
 at java.base/java.lan

[jira] [Commented] (SLING-11189) Content Loader: Race condition registering readers vs. loading content

2022-03-08 Thread Julian Sedding (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-11189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17502951#comment-17502951
 ] 

Julian Sedding commented on SLING-11189:


Purely with DS and OSGi R7, I think it could be done with a combination of the 
{{*.target*}} *and the {{}}*{{.minimum.cardinality}} [reference 
properties|http://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.component.html#service.component-reference.properties].

The {{contentReader.target}} reference property would need to OR together a 
list of {{component.name}} properties, i.e. 
{{{}(|(component.name=org.apache.sling.jcr.contentloader.internal.readers.JsonReader)(component.name=org.apache.sling.jcr.contentloader.internal.readers.OrderedJsonReader)(component.name=org.apache.sling.jcr.contentloader.internal.readers.XmlReader)(component.name=org.apache.sling.jcr.contentloader.internal.readers.ZipReader)){}}}.

And the {{contentReader.minimum.cardinality}} property would need to be set to 
the number of readers, i.e. 4 in this case.

Unless I am missing something, this should work. WDYT?

> Content Loader: Race condition registering readers vs. loading content
> --
>
> Key: SLING-11189
> URL: https://issues.apache.org/jira/browse/SLING-11189
> Project: Sling
>  Issue Type: Bug
>  Components: Extensions
>Affects Versions: JCR ContentLoader 2.5.0
>Reporter: Stefan Seifert
>Assignee: Stefan Seifert
>Priority: Major
>
> in SLING-11168 we detected a specific problem with Composum in Sling Starter 
> 12, which only occured on Windows 10 environments (and even there not 
> consistently in every scenario).
> it seems that it may happen that Sling-Initial-Content is loaded from the 
> bundles when the ContentReader implementations are not yet registered on the 
> ContentReaderWhiteboard.
> when this happens, the content is loaded into the repository, but files like 
> *.json are not transformed to nodes and properties, but is stored as binary 
> json files in the repository.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (SLING-11157) Emit content distribution metrics per action type

2022-03-08 Thread Christian Schneider (Jira)


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

Christian Schneider updated SLING-11157:

Fix Version/s: Content Distribution Journal Core 0.1.26
   (was: Content Distribution Journal Core 0.1.25)

> Emit content distribution metrics per action type
> -
>
> Key: SLING-11157
> URL: https://issues.apache.org/jira/browse/SLING-11157
> Project: Sling
>  Issue Type: Improvement
>  Components: Content Distribution
>Reporter: José Correia
>Assignee: José Correia
>Priority: Major
> Fix For: Content Distribution Journal Core 0.1.26
>
>
> This change is related to the addition of the new {{INVALIDATE}} action to 
> create cache invalidation distribution requests, as described in:
>  * https://issues.apache.org/jira/browse/SLING-10585
>  
> We want to improve the observability of the content distribution requests by 
> emitting metrics per action type, which can have the following values:
>  * {{ADD}}
>  * {{DELETE}}
>  * {{INVALIDATE}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (SLING-10585) Add support for invalidation requests

2022-03-08 Thread Christian Schneider (Jira)


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

Christian Schneider updated SLING-10585:

Fix Version/s: Content Distribution Journal Core 0.1.26
   (was: Content Distribution Journal Core 0.1.24)

> Add support for invalidation requests
> -
>
> Key: SLING-10585
> URL: https://issues.apache.org/jira/browse/SLING-10585
> Project: Sling
>  Issue Type: New Feature
>  Components: Content Distribution
>Reporter: Timothee Maret
>Assignee: Timothee Maret
>Priority: Major
> Fix For: Content Distribution Journal Core 0.1.26
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Caching invalidation is typically triggered by content distribution, after 
> processing an `ADD` or `DELETE` distribution request. When distributing 
> referenced content, invalidation must also include on the referencing 
> resources. To support this use case, we'll add support for a new type of 
> distribution request that invalidates the caches without importing content.
> To support this, the org.apache.sling.distribution.DistributionRequestType 
> API will be extended with
> {code:java}
> /**
>  * Action type for invalidating content
>  */
> INVALIDATE,
> {code}
> The PackageMessage.ReqType will be extended with the new INVALIDATION type.
> The DistributionPublisher will handle the invalidation distribution requests 
> by sending a package message with the INVALIDATION type and no payload (like 
> the DELETE package messages).
> The DistributionSubscriber will process invalidation messages by raising 
> imported events and invoking the import post processors.  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (SLING-11157) Emit content distribution metrics per action type

2022-03-08 Thread Christian Schneider (Jira)


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

Christian Schneider updated SLING-11157:

Fix Version/s: Content Distribution Journal Core 0.1.25
   (was: Content Distribution Journal Core 0.1.24)

> Emit content distribution metrics per action type
> -
>
> Key: SLING-11157
> URL: https://issues.apache.org/jira/browse/SLING-11157
> Project: Sling
>  Issue Type: Improvement
>  Components: Content Distribution
>Reporter: José Correia
>Assignee: José Correia
>Priority: Major
> Fix For: Content Distribution Journal Core 0.1.25
>
>
> This change is related to the addition of the new {{INVALIDATE}} action to 
> create cache invalidation distribution requests, as described in:
>  * https://issues.apache.org/jira/browse/SLING-10585
>  
> We want to improve the observability of the content distribution requests by 
> emitting metrics per action type, which can have the following values:
>  * {{ADD}}
>  * {{DELETE}}
>  * {{INVALIDATE}}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (SLING-9017) ErrorQueueDispatchingStrategy ends up using an incorrect QueueProvider

2022-03-08 Thread Christian Schneider (Jira)


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

Christian Schneider updated SLING-9017:
---
Fix Version/s: Content Distribution Core 0.4.11
   (was: Content Distribution Core 0.4.10)

> ErrorQueueDispatchingStrategy ends up using an incorrect QueueProvider
> --
>
> Key: SLING-9017
> URL: https://issues.apache.org/jira/browse/SLING-9017
> Project: Sling
>  Issue Type: Bug
>  Components: Content Distribution
>Reporter: Ashish Chopra
>Priority: Major
> Fix For: Content Distribution Core 0.4.11
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently, {{ErrorQueueDispatchingStrategy}} [0] interface dictates that the 
> {{.add}} [1] method supplies the {{DistributionQueueProvider}} [1] to it.
> For {{ForwardDistributionAgentFactory}} (and perhaps other Agent-factories as 
> well), this {{DistributionQueueProvider}} is further used to {{.getQueue}} by 
> a name [2].
> As the discussion in SLING-8854 concluded, it was found acceptable [3] for 
> {{DistributionQueue}} impls and {{DistributionQueueProvider}} impls to share 
> state - concordantly, there needs to be a way for Agent-Factories to dictate 
> which _specific_ queue-providers they want {{ErrorQueueDispatchingStrategy}} 
> to use.
> One approach to make that happen would be to enhance 
> {{ErrorQueueDispatchingStrategy}}  with another CTOR to accept a 
> {{DistributionQueueProvider}} argument. The impl of {{.add}} can then treat 
> the supplied {{DistributionQueueProvider}} at the time of API invocation as a 
> 'hint' and ignore it if the {{ErrorQueueDispatchingStrategy}} already has one 
> of its own.
> [0] 
> https://github.com/apache/sling-org-apache-sling-distribution-core/blob/master/src/main/java/org/apache/sling/distribution/queue/impl/ErrorQueueDispatchingStrategy.java
> [1] 
> https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/queue/impl/ErrorQueueDispatchingStrategy.java#L56
> [2] 
> https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessor.java#L187
> [3] 
> https://issues.apache.org/jira/browse/SLING-8854?focusedCommentId=16982396&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16982396



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (SLING-8994) Optimize session saves for Single Queue Dispatching Strategy

2022-03-08 Thread Christian Schneider (Jira)


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

Christian Schneider updated SLING-8994:
---
Fix Version/s: Content Distribution Core 0.4.11
   (was: Content Distribution Core 0.4.10)

> Optimize session saves for Single Queue Dispatching Strategy
> 
>
> Key: SLING-8994
> URL: https://issues.apache.org/jira/browse/SLING-8994
> Project: Sling
>  Issue Type: Bug
>  Components: Content Distribution
>Reporter: Ashish Chopra
>Priority: Major
> Fix For: Content Distribution Core 0.4.11
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Separation of concerns dictate that there's a loose coupling between 
> Distribution Packages and Queue entries, and thus the distribution-packages 
> and queue-items are persisted in different sessions (indeed, depending on 
> queue-impl/distribution-packaging-impl chosen there may not be a need to 
> persist either, or any of them at all).
> To enable collection of unreferenced Distribution packages, currently, queue 
> items are be acquired [0] and released [1] on a per-queue basis in 
> {{MultipleQueueDispatchingStrategy}}. Only the distribution-packages that 
> don't have any live references are claimed.
> For a 1:1 distribution (as {{SingleQueueDispatchingStrategy}} [2] aims to 
> achieve), acquring and releasing packages is superfluous (since there's only 
> one queue) and as such it should just be sufficient to mark the package 
> 'released' [3] once the queue is done with it.
> However, the ref-updates still happen given way it is implemented currently 
> (as a subclass of {{MultipleQueueDispatchingStrategy}} that doesn't override 
> anything [2]).
> Opening this issue propose improving {{SingleQueueDispatchingStrategy}} impl. 
> This should slightly optimize the book-keeping and marginally reduce the 
> write-overhead for 1:1 distribution.
> [0] 
> https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/queue/impl/MultipleQueueDispatchingStrategy.java#L61
> [1] 
> https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/agent/impl/SimpleDistributionAgentQueueProcessor.java#L169
> [2] 
> https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/queue/impl/SingleQueueDispatchingStrategy.java
> [3] 
> https://github.com/apache/sling-org-apache-sling-distribution-core/blob/537bb57af821f21537cf4a24ad7d2347c6a5dae1/src/main/java/org/apache/sling/distribution/packaging/impl/DistributionPackageUtils.java#L107-L111



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Updated] (SLING-10133) Memory leak in MonitoringDistributionPackageBuilder

2022-03-08 Thread Christian Schneider (Jira)


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

Christian Schneider updated SLING-10133:

Fix Version/s: Content Distribution Core 0.4.11
   (was: Content Distribution Core 0.4.10)

> Memory leak in MonitoringDistributionPackageBuilder
> ---
>
> Key: SLING-10133
> URL: https://issues.apache.org/jira/browse/SLING-10133
> Project: Sling
>  Issue Type: Bug
>  Components: Content Distribution
>Affects Versions: Content Distribution Core 0.4.0
>Reporter: Timothee Maret
>Priority: Major
> Fix For: Content Distribution Core 0.4.11
>
>
> The MonitoringDistributionPackageBuilder maintain a list of MBean for the 
> latest packages. The number of packages to be monitored is passed as the 
> [queueCapacity|https://github.com/apache/sling-org-apache-sling-distribution-core/blob/b80cd8f3bae6b7875387ee7caaea271b7e9baec6/src/main/java/org/apache/sling/distribution/monitor/impl/MonitoringDistributionPackageBuilder.java#L49]
>  via the constructor. When the queueCapacity is 0, the monitoring is disabled.
> [VaultDistributionPackageBuilderFactory|https://github.com/apache/sling-org-apache-sling-distribution-core/blob/b80cd8f3bae6b7875387ee7caaea271b7e9baec6/src/main/java/org/apache/sling/distribution/serialization/impl/vlt/VaultDistributionPackageBuilderFactory.java#L201]
>  and 
> [DistributionPackageBuilderFactory|https://github.com/apache/sling-org-apache-sling-distribution-core/blob/b80cd8f3bae6b7875387ee7caaea271b7e9baec6/src/main/java/org/apache/sling/distribution/serialization/impl/DistributionPackageBuilderFactory.java]
>  disable this feature by default. An environment that runs for multiple weeks 
> without restart and with the default configuration will experience a memory 
> leak that leads to the JVM running out of memory.
> The implementation has two flaws that explain the memory leak.
>  
> h2. #1 - Registering a MBean when the queueCapacity is 0
> The code [unconditionally registers a 
> MBean|https://github.com/apache/sling-org-apache-sling-distribution-core/blob/b80cd8f3bae6b7875387ee7caaea271b7e9baec6/src/main/java/org/apache/sling/distribution/monitor/impl/MonitoringDistributionPackageBuilder.java#L106]
>  even if the queueCapacity is 0. We need to only register a MBean when the 
> capacity is > 0.
> h2. #2 - Concurrency issue when un-registering MBean
> The code [attempts to 
> remove|https://github.com/apache/sling-org-apache-sling-distribution-core/blob/b80cd8f3bae6b7875387ee7caaea271b7e9baec6/src/main/java/org/apache/sling/distribution/monitor/impl/MonitoringDistributionPackageBuilder.java#L108]
>  by checking if the queueCapacity equals the list of MBeans. This check works 
> in a single threaded context but it falls short when 
> registerDistributionPackageMBean is invoked concurrently. In the latter case, 
> it can happen that the check never holds true leading the mBeans queue to 
> grow indefinitely. One solution is to leverage the features of the 
> LinkedBlockingDeque. Create a LinkedBlockingDeque with bounded capacity and 
> rely on the returned status from the offer method to decide if an item needs 
> to be removed.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Resolved] (SLING-8595) Update of sling parent pom

2022-03-08 Thread Christian Schneider (Jira)


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

Christian Schneider resolved SLING-8595.

Fix Version/s: (was: Content Distribution Core 0.4.10)
   Resolution: Won't Fix

> Update of sling parent pom
> --
>
> Key: SLING-8595
> URL: https://issues.apache.org/jira/browse/SLING-8595
> Project: Sling
>  Issue Type: Sub-task
>  Components: Content Distribution
>Reporter: Christian Schneider
>Assignee: Christian Schneider
>Priority: Blocker
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> When running upstream modules together with sling distribution core in 
> eclipse I got issues as the outdated osgi core jar slipped into the build 
> dependencies of the upstream module.
> I found that updating the parent pom fixed the issue. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Resolved] (SLING-11190) Upgrade to current sling parent and sling mocks

2022-03-08 Thread Christian Schneider (Jira)


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

Christian Schneider resolved SLING-11190.
-
Resolution: Fixed

> Upgrade to current sling parent and sling mocks
> ---
>
> Key: SLING-11190
> URL: https://issues.apache.org/jira/browse/SLING-11190
> Project: Sling
>  Issue Type: Improvement
>  Components: Content Distribution
>Affects Versions: Content Distribution Journal Core 0.1.22
>Reporter: Christian Schneider
>Assignee: Christian Schneider
>Priority: Major
> Fix For: Content Distribution Journal Core 0.1.24
>
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Commented] (SLING-10585) Add support for invalidation requests

2022-03-08 Thread Timothee Maret (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-10585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17502829#comment-17502829
 ] 

Timothee Maret commented on SLING-10585:


Thank you [~balasoiu]! I have reviewed your PRs and left some comments. Once 
the PRs 
[#11|https://github.com/apache/sling-org-apache-sling-distribution-api/pull/11] 
and 
[#9|https://github.com/apache/sling-org-apache-sling-distribution-journal-messages/pull/9]
 are ready, we could release the corresponding bundles and reference them in PR 
[#101|https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/101].

> Add support for invalidation requests
> -
>
> Key: SLING-10585
> URL: https://issues.apache.org/jira/browse/SLING-10585
> Project: Sling
>  Issue Type: New Feature
>  Components: Content Distribution
>Reporter: Timothee Maret
>Assignee: Timothee Maret
>Priority: Major
> Fix For: Content Distribution Journal Core 0.1.24
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Caching invalidation is typically triggered by content distribution, after 
> processing an `ADD` or `DELETE` distribution request. When distributing 
> referenced content, invalidation must also include on the referencing 
> resources. To support this use case, we'll add support for a new type of 
> distribution request that invalidates the caches without importing content.
> To support this, the org.apache.sling.distribution.DistributionRequestType 
> API will be extended with
> {code:java}
> /**
>  * Action type for invalidating content
>  */
> INVALIDATE,
> {code}
> The PackageMessage.ReqType will be extended with the new INVALIDATION type.
> The DistributionPublisher will handle the invalidation distribution requests 
> by sending a package message with the INVALIDATION type and no payload (like 
> the DELETE package messages).
> The DistributionSubscriber will process invalidation messages by raising 
> imported events and invoking the import post processors.  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


Re: Enable Web Analytics with Matomo?

2022-03-08 Thread Bertrand Delacretaz
Hi,

Le lun. 7 mars 2022 à 16:34, Konrad Windszus  a écrit :
>... WDYT about enabling web analytics with Matomo to learn more about our 
>visitors?..

I'm +0, meaning If someone wants to do the work I'm all for it.

-Bertrand


[jira] [Commented] (SLING-7969) Memory leak in DiscoveryLiteDescriptor

2022-03-08 Thread Timothee Maret (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-7969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17502782#comment-17502782
 ] 

Timothee Maret commented on SLING-7969:
---

Thanks [~sagarmiglani] for your analysis. I think that closing the reader makes 
sense. [~stefanegli] wdyt ? 

I have opened the PR 
[#5|https://github.com/apache/sling-org-apache-sling-discovery-commons/pull/5] 
with the change.

> Memory leak in DiscoveryLiteDescriptor
> --
>
> Key: SLING-7969
> URL: https://issues.apache.org/jira/browse/SLING-7969
> Project: Sling
>  Issue Type: Bug
>  Components: Discovery
>Affects Versions: Discovery Commons 1.0.20
>Reporter: Timothee Maret
>Assignee: Timothee Maret
>Priority: Major
>  Labels: discovery
> Attachments: Screenshot 2022-03-07 at 1.05.33 PM.png, Screenshot 
> 2022-03-07 at 1.14.57 PM-1.png, Screenshot 2022-03-07 at 1.14.57 PM.png, 
> Screenshot 2022-03-07 at 1.18.07 PM.png, Screenshot 2022-03-07 at 1.18.16 
> PM.png, Screenshot 2022-03-07 at 12.26.11 PM.png, 
> org.apache.sling.commons.johnzon-1.1.11-SLING-7969.jar, 
> org.apache.sling.discovery.commons-1.0.23-SLING-7969.jar
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> As identified in [~volteanu]'s adaptTo 
> [presentation|https://adapt.to/2018/en/schedule/sling-memory-deep-dive.html], 
> it seems that Sling Discovery on Oak is consuming 42MB of RAM on a standard 
> instance.
> Sling discovery deals with transient states (the views, leases, etc.) and is 
> not caching significant amount of data. The 42MB figure for the discovery 
> feature seems like a symptom of a memory leak.
> [~volteanu] shared in his presentation that the 42MB worth of RAM was mainly 
> consumed by a Json Factory reference. There is one static JsonReaderFactory 
> in the discovery commons module, in the 
> [DiscoveryLiteDescriptor|https://github.com/apache/sling-org-apache-sling-discovery-commons/blob/master/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java].
> Looking at the code, it seems that each invocation of the 
> [getDescriptorFrom|https://github.com/apache/sling-org-apache-sling-discovery-commons/blob/master/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java#L51]
>  method creates a JSON reader but never close it. This may may leave 
> resources behind as hinted by the description of the 
> [close|https://docs.oracle.com/javaee/7/api/javax/json/JsonReader.html#close--]
>  method in the API. AFAIK, the 
> [getDescriptorFrom|https://github.com/apache/sling-org-apache-sling-discovery-commons/blob/master/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/DiscoveryLiteDescriptor.java#L51]
>  is invoked periodically on a relatively high frequency (< seconds) which may 
> be the trigger for the leak on all instances.
> This is only a supposition for now, it should be investigated further, simply 
> by running a patched version of \{{org.apache.sling.discovery.commons}} that 
> make sure each JSON reader is properly closed.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)