[GitHub] [sling-org-apache-sling-jms] sonarcloud[bot] commented on pull request #3: SLING-11382: Sling update to 47
sonarcloud[bot] commented on PR #3: URL: https://github.com/apache/sling-org-apache-sling-jms/pull/3#issuecomment-1722086484 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-jms=3) [![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-jms=3=false=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-jms=3=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-jms=3=false=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-jms=3=false=VULNERABILITY) [![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-jms=3=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-jms=3=false=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-jms=3=false=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-jms=3=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-jms=3=false=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-jms=3=false=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-jms=3=false=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-jms=3=false=CODE_SMELL) [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-jms=3=coverage=list) No Coverage information [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-jms=3=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-jms=3=new_duplicated_lines_density=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-resourceresolver] sonarcloud[bot] commented on pull request #104: SLING-12019 - Avoid duplicate ResourceResolverFactory registrations
sonarcloud[bot] commented on PR #104: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/104#issuecomment-1721337858 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver=104) [![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-resourceresolver=104=false=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-resourceresolver=104=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=VULNERABILITY) [![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-resourceresolver=104=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=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-resourceresolver=104=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=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-resourceresolver=104=false=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=CODE_SMELL) [![89.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '89.5%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_coverage=list) [89.5% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_coverage=list) [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_duplicated_lines_density=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-resourceresolver] sonarcloud[bot] commented on pull request #104: SLING-12019 - Avoid duplicate ResourceResolverFactory registrations
sonarcloud[bot] commented on PR #104: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/104#issuecomment-1721293146 Please retry analysis of this Pull-Request directly on [SonarCloud](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104). -- 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-resourceresolver] sonarcloud[bot] commented on pull request #104: SLING-12019 - Avoid duplicate ResourceResolverFactory registrations
sonarcloud[bot] commented on PR #104: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/104#issuecomment-1721290631 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver=104) [![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-resourceresolver=104=false=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-resourceresolver=104=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=VULNERABILITY) [![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-resourceresolver=104=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=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-resourceresolver=104=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=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-resourceresolver=104=false=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=CODE_SMELL) [![89.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '89.5%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_coverage=list) [89.5% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_coverage=list) [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_duplicated_lines_density=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-12024) Import package message if status message with higher package offset arrives
[ https://issues.apache.org/jira/browse/SLING-12024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christian Schneider updated SLING-12024: Summary: Import package message if status message with higher package offset arrives (was: mport package message if status message with higher package offset arrives) > Import package message if status message with higher package offset arrives > --- > > Key: SLING-12024 > URL: https://issues.apache.org/jira/browse/SLING-12024 > Project: Sling > Issue Type: Improvement > Components: Content Distribution >Reporter: Christian Schneider >Assignee: Christian Schneider >Priority: Major > > We wait for status message for a package message before applying the package. > If this status message never arrives we are stuck and the pod needs to be > restarted. > To improve this we should continue and import the package if a status message > referencing a higher offset arrives. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Created] (SLING-12024) mport package message if status message with higher package offset arrives
Christian Schneider created SLING-12024: --- Summary: mport package message if status message with higher package offset arrives Key: SLING-12024 URL: https://issues.apache.org/jira/browse/SLING-12024 Project: Sling Issue Type: Improvement Components: Content Distribution Reporter: Christian Schneider Assignee: Christian Schneider We wait for status message for a package message before applying the package. If this status message never arrives we are stuck and the pod needs to be restarted. To improve this we should continue and import the package if a status message referencing a higher offset arrives. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[GitHub] [sling-org-apache-sling-resourceresolver] sonarcloud[bot] commented on pull request #104: SLING-12019 - Avoid duplicate ResourceResolverFactory registrations
sonarcloud[bot] commented on PR #104: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/104#issuecomment-1721234208 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver=104) [![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-resourceresolver=104=false=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-resourceresolver=104=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=VULNERABILITY) [![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-resourceresolver=104=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=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-resourceresolver=104=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=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-resourceresolver=104=false=CODE_SMELL) [8 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=CODE_SMELL) [![89.5%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '89.5%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_coverage=list) [89.5% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_coverage=list) [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_duplicated_lines_density=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
[Jenkins] Sling » Modules » sling-org-apache-sling-starter » master #1018 is FIXED
Please see https://ci-builds.apache.org/job/Sling/job/modules/job/sling-org-apache-sling-starter/job/master/1018/ for details. No further emails will be sent until the status of the build is changed.
[GitHub] [sling-org-apache-sling-resourceresolver] jsedding commented on a diff in pull request #104: SLING-12019 - Avoid duplicate ResourceResolverFactory registrations
jsedding commented on code in PR #104: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/104#discussion_r1327220837 ## src/main/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandler.java: ## @@ -77,15 +117,24 @@ public void close() { void maybeRegisterFactory(final String unavailableName, final String unavailableServicePid) { if (!factoryRegistrationWorker.isShutdown()) { LOG.debug("submitting maybeRegisterFactory"); -factoryRegistrationWorker.submit(() -> { -final boolean preconditionsOk = factoryPreconditions.checkPreconditions(unavailableName, unavailableServicePid); -if ( preconditionsOk && this.factoryRegistration == null ) { +final boolean preconditionsOk; +final ResourceResolverFactoryActivator localActivator; +try { +configurationLock.lock(); +preconditionsOk = factoryPreconditions.checkPreconditions(unavailableName, unavailableServicePid); +localActivator = this.activator; +} finally { +configurationLock.unlock(); +} + +factoryRegistrationWorker.execute(() -> { +if (preconditionsOk && this.factoryRegistration == null) { Review Comment: Again, same as abov. I'll add the `registrationLock` here. -- 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-resourceresolver] jsedding commented on a diff in pull request #104: SLING-12019 - Avoid duplicate ResourceResolverFactory registrations
jsedding commented on code in PR #104: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/104#discussion_r1327220032 ## src/main/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandler.java: ## @@ -30,45 +30,85 @@ import java.util.Dictionary; import java.util.Hashtable; +import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReentrantLock; public class FactoryRegistrationHandler implements AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(FactoryRegistrationHandler.class); -private final ResourceResolverFactoryActivator activator; +private final ExecutorService factoryRegistrationWorker; -private final FactoryPreconditions factoryPreconditions; +/** + * The configurationLock serializes access to the fields {@code activator} + * and {@code factoryPreconditions}. Each access to these fields must be + * guarded by this lock. + */ +private final ReentrantLock configurationLock = new ReentrantLock(); -private final ExecutorService factoryRegistrationWorker; +/** Access only when holding configurationLock */ +private ResourceResolverFactoryActivator activator; + +/** Access only when holding configurationLock */ +private FactoryPreconditions factoryPreconditions; + +/** + * The registrationLock serializes access to the field {@code factoryRegistration}. + * Each access to these field must be guarded by this lock. + */ +private final ReentrantLock registrationLock = new ReentrantLock(); -@SuppressWarnings("java:S3077") // The field is only ever set to null or to a new FactoryRegistration instance, which is safe. -private volatile FactoryRegistration factoryRegistration; +/** Access only when holding registrationLock */ +private FactoryRegistration factoryRegistration; -public FactoryRegistrationHandler( -ResourceResolverFactoryActivator activator, FactoryPreconditions factoryPreconditions) { -this.factoryPreconditions = factoryPreconditions; -this.activator = activator; +public FactoryRegistrationHandler() { this.factoryRegistrationWorker = Executors.newSingleThreadExecutor( r -> new Thread(r, ResourceResolverFactory.class.getSimpleName() + " registration/deregistration")); } +public void configure(ResourceResolverFactoryActivator activator, FactoryPreconditions factoryPreconditions) { +checkClosed(); + +boolean reRegister; +try { +configurationLock.lock(); +reRegister = this.activator != activator || !Objects.equals(this.factoryPreconditions, factoryPreconditions); +LOG.debug("activator differs = {}, factoryPreconditions differ = {}", this.activator != activator, !Objects.equals(this.factoryPreconditions, factoryPreconditions)); +LOG.debug("factoryPreconditions {} vs {}", this.factoryPreconditions, factoryPreconditions); +this.factoryPreconditions = factoryPreconditions; +this.activator = activator; +} finally { +configurationLock.unlock(); +} + +if (reRegister) { +if (this.factoryRegistration != null) { Review Comment: You are right to spot the missing lock. But the `registrationLock` is required when accessing `factoryRegistration`. -- 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
[Jenkins] Sling » Modules » sling-org-apache-sling-starter » master #1017 is BROKEN
-component-annotations/2.1.0/plexus-component-annotations-2.1.0.jar [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar (332 kB at 5.2 MB/s) [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.jar [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.jar (35 kB at 536 kB/s) [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.jar (30 kB at 341 kB/s) [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar (51 kB at 579 kB/s) [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-component-annotations/2.1.0/plexus-component-annotations-2.1.0.jar (4.2 kB at 47 kB/s) [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.jar (12 kB at 137 kB/s) [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar (480 kB at 4.4 MB/s) [INFO] Enabled default license matchers. [INFO] Will parse SCM ignores for exclusions... [INFO] Parsing exclusions from /home/jenkins/jenkins-agent/workspace/_org-apache-sling-starter_master@2/jdk_21_latest/.gitignore [INFO] Finished adding exclusions from SCM ignore files. [INFO] 79 implicit excludes. [INFO] 15 explicit excludes. [INFO] 21 resources included [INFO] Rat check: Summary over all files. Unapproved: 0, unknown: 0, generated: 0, approved: 20 licenses. [INFO] [INFO] --- docker:0.43.4:stop (stop-mongo) @ org.apache.sling.starter --- [INFO] DOCKER> [mongo:4.4.6] "mongo": Stop and removed container 9e6d42fcd006 after 0 ms [INFO] [INFO] --- failsafe:3.0.0-M5:verify (default) @ org.apache.sling.starter --- [INFO] Failsafe report directory: /home/jenkins/jenkins-agent/workspace/_org-apache-sling-starter_master@2/jdk_21_latest/target/failsafe-reports [INFO] [INFO] BUILD FAILURE [INFO] [INFO] Total time: 06:56 min [INFO] Finished at: 2023-09-15T12:21:58Z [INFO] [INFO] [jenkins-event-spy] Generated /home/jenkins/jenkins-agent/workspace/_org-apache-sling-starter_master@2/jdk_21_latest@tmp/withMavenda3a7f40/maven-spy-20230915-121501-38415245270239829771918.log [ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M5:verify (default) on project org.apache.sling.starter: There are test failures. [ERROR] [ERROR] Please refer to /home/jenkins/jenkins-agent/workspace/_org-apache-sling-starter_master@2/jdk_21_latest/target/failsafe-reports for the individual test results. [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M5:verify (default) on project org.apache.sling.starter: There are test failures. Please refer to /home/jenkins/jenkins-agent/workspace/_org-apache-sling-starter_master@2/jdk_21_latest/target/failsafe-reports for the individual test results. Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreade
[GitHub] [sling-org-apache-sling-starter] rombert merged pull request #233: chore(deps): update docker/setup-qemu-action action to v3
rombert merged PR #233: URL: https://github.com/apache/sling-org-apache-sling-starter/pull/233 -- 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-starter] rombert merged pull request #232: chore(deps): update docker/setup-buildx-action action to v3
rombert merged PR #232: URL: https://github.com/apache/sling-org-apache-sling-starter/pull/232 -- 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-starter] rombert merged pull request #231: chore(deps): update docker/login-action action to v3
rombert merged PR #231: URL: https://github.com/apache/sling-org-apache-sling-starter/pull/231 -- 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-starter] renovate-bot opened a new pull request, #233: chore(deps): update docker/setup-qemu-action action to v3
renovate-bot opened a new pull request, #233: URL: https://github.com/apache/sling-org-apache-sling-starter/pull/233 [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [docker/setup-qemu-action](https://togithub.com/docker/setup-qemu-action) | action | major | `v2` -> `v3` | --- ### Release Notes docker/setup-qemu-action (docker/setup-qemu-action) ### [`v3`](https://togithub.com/docker/setup-qemu-action/compare/v2...v3) [Compare Source](https://togithub.com/docker/setup-qemu-action/compare/v2...v3) --- ### Configuration **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/apache/sling-org-apache-sling-starter). -- 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-starter] renovate-bot opened a new pull request, #232: chore(deps): update docker/setup-buildx-action action to v3
renovate-bot opened a new pull request, #232: URL: https://github.com/apache/sling-org-apache-sling-starter/pull/232 [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [docker/setup-buildx-action](https://togithub.com/docker/setup-buildx-action) | action | major | `v2` -> `v3` | --- ### Release Notes docker/setup-buildx-action (docker/setup-buildx-action) ### [`v3`](https://togithub.com/docker/setup-buildx-action/compare/v2...v3) [Compare Source](https://togithub.com/docker/setup-buildx-action/compare/v2...v3) --- ### Configuration **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/apache/sling-org-apache-sling-starter). -- 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-starter] renovate-bot opened a new pull request, #231: chore(deps): update docker/login-action action to v3
renovate-bot opened a new pull request, #231: URL: https://github.com/apache/sling-org-apache-sling-starter/pull/231 [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [docker/login-action](https://togithub.com/docker/login-action) | action | major | `v2` -> `v3` | --- ### Release Notes docker/login-action (docker/login-action) ### [`v3`](https://togithub.com/docker/login-action/compare/v2...v3) [Compare Source](https://togithub.com/docker/login-action/compare/v2...v3) --- ### Configuration **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/apache/sling-org-apache-sling-starter). -- 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-resourceresolver] rombert commented on a diff in pull request #104: SLING-12019 - Avoid duplicate ResourceResolverFactory registrations
rombert commented on code in PR #104: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/104#discussion_r1327152813 ## src/main/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandler.java: ## @@ -30,45 +30,85 @@ import java.util.Dictionary; import java.util.Hashtable; +import java.util.Objects; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReentrantLock; public class FactoryRegistrationHandler implements AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(FactoryRegistrationHandler.class); -private final ResourceResolverFactoryActivator activator; +private final ExecutorService factoryRegistrationWorker; -private final FactoryPreconditions factoryPreconditions; +/** + * The configurationLock serializes access to the fields {@code activator} + * and {@code factoryPreconditions}. Each access to these fields must be + * guarded by this lock. + */ +private final ReentrantLock configurationLock = new ReentrantLock(); -private final ExecutorService factoryRegistrationWorker; +/** Access only when holding configurationLock */ +private ResourceResolverFactoryActivator activator; + +/** Access only when holding configurationLock */ +private FactoryPreconditions factoryPreconditions; + +/** + * The registrationLock serializes access to the field {@code factoryRegistration}. + * Each access to these field must be guarded by this lock. + */ +private final ReentrantLock registrationLock = new ReentrantLock(); -@SuppressWarnings("java:S3077") // The field is only ever set to null or to a new FactoryRegistration instance, which is safe. -private volatile FactoryRegistration factoryRegistration; +/** Access only when holding registrationLock */ +private FactoryRegistration factoryRegistration; -public FactoryRegistrationHandler( -ResourceResolverFactoryActivator activator, FactoryPreconditions factoryPreconditions) { -this.factoryPreconditions = factoryPreconditions; -this.activator = activator; +public FactoryRegistrationHandler() { this.factoryRegistrationWorker = Executors.newSingleThreadExecutor( r -> new Thread(r, ResourceResolverFactory.class.getSimpleName() + " registration/deregistration")); } +public void configure(ResourceResolverFactoryActivator activator, FactoryPreconditions factoryPreconditions) { +checkClosed(); + +boolean reRegister; +try { +configurationLock.lock(); +reRegister = this.activator != activator || !Objects.equals(this.factoryPreconditions, factoryPreconditions); +LOG.debug("activator differs = {}, factoryPreconditions differ = {}", this.activator != activator, !Objects.equals(this.factoryPreconditions, factoryPreconditions)); +LOG.debug("factoryPreconditions {} vs {}", this.factoryPreconditions, factoryPreconditions); +this.factoryPreconditions = factoryPreconditions; +this.activator = activator; +} finally { +configurationLock.unlock(); +} + +if (reRegister) { +if (this.factoryRegistration != null) { Review Comment: Should this check be done inside the critical region protected by the `configurationLock`? ## src/main/java/org/apache/sling/resourceresolver/impl/FactoryRegistrationHandler.java: ## @@ -77,15 +117,24 @@ public void close() { void maybeRegisterFactory(final String unavailableName, final String unavailableServicePid) { if (!factoryRegistrationWorker.isShutdown()) { LOG.debug("submitting maybeRegisterFactory"); -factoryRegistrationWorker.submit(() -> { -final boolean preconditionsOk = factoryPreconditions.checkPreconditions(unavailableName, unavailableServicePid); -if ( preconditionsOk && this.factoryRegistration == null ) { +final boolean preconditionsOk; +final ResourceResolverFactoryActivator localActivator; +try { +configurationLock.lock(); +preconditionsOk = factoryPreconditions.checkPreconditions(unavailableName, unavailableServicePid); +localActivator = this.activator; +} finally { +configurationLock.unlock(); +} + +factoryRegistrationWorker.execute(() -> { +if (preconditionsOk && this.factoryRegistration == null) { Review Comment: What are the consequences of making an "unsychronized" read of `this.factoryRegistration` in this method? -- 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
[GitHub] [sling-org-apache-sling-resourceresolver] sonarcloud[bot] commented on pull request #104: SLING-12019 - Avoid duplicate ResourceResolverFactory registrations
sonarcloud[bot] commented on PR #104: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/104#issuecomment-1721004758 Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-resourceresolver=104) [![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-resourceresolver=104=false=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-resourceresolver=104=false=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=VULNERABILITY) [![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-resourceresolver=104=false=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=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-resourceresolver=104=false=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-resourceresolver=104=false=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-resourceresolver=104=false=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-resourceresolver=104=false=CODE_SMELL) [8 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-resourceresolver=104=false=CODE_SMELL) [![90.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90-16px.png '90.6%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_coverage=list) [90.6% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_coverage=list) [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_duplicated_lines_density=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-resourceresolver=104=new_duplicated_lines_density=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-resourceresolver] jsedding opened a new pull request, #104: SLING-12019 - Avoid duplicate ResourceResolverFactory registrations
jsedding opened a new pull request, #104: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/104 - reworked synchronization from relying on worker queue to locks - increased test coverage, particularly for concurrent scenarios - switched to junit-platform to allow mixing junit4 and junit5 tests - enabled parallel test execution for junit-platform -- 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