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

Stefan Egli resolved SLING-10204.
---------------------------------
    Resolution: Fixed

marking fixed. The SNAPSHOT dependency will be resolved at release time 
(currently the build fails if the SNAPSHOT isn't freshly built)

> Make OakDiscoveryService.updatedPropertyProvider tolerate deactivated 
> repository
> --------------------------------------------------------------------------------
>
>                 Key: SLING-10204
>                 URL: https://issues.apache.org/jira/browse/SLING-10204
>             Project: Sling
>          Issue Type: Task
>          Components: Discovery
>            Reporter: Stefan Egli
>            Assignee: Stefan Egli
>            Priority: Minor
>             Fix For: Discovery Oak 1.2.32
>
>         Attachments: SLING-10204-2.git.patch
>
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> The following exception has been witnessed during resource resolver factory 
> unregistration:
> {noformat}
> java.lang.IllegalArgumentException: Can't create child on a synthetic root
>         at 
> org.apache.sling.resourceresolver.impl.ResourceResolverImpl.create(ResourceResolverImpl.java:979)
>  [org.apache.sling.resourceresolver:1.7.2]
> ...
>         at 
> org.apache.sling.api.resource.ResourceUtil.getOrCreateResource(ResourceUtil.java:571)
>  [org.apache.sling.api:2.22.0]
>         at 
> org.apache.sling.discovery.commons.providers.util.ResourceHelper.getOrCreateResource(ResourceHelper.java:45)
>  [org.apache.sling.discovery.commons:1.0.20]
>         at 
> org.apache.sling.discovery.oak.OakDiscoveryService.doUpdateProperties(OakDiscoveryService.java:492)
>  [org.apache.sling.discovery.oak:1.2.30]
>         at 
> org.apache.sling.discovery.oak.OakDiscoveryService.bindPropertyProviderInteral(OakDiscoveryService.java:406)
>  [org.apache.sling.discovery.oak:1.2.30]
>         at 
> org.apache.sling.discovery.oak.OakDiscoveryService.updatedPropertyProvider(OakDiscoveryService.java:421)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at jdk.internal.reflect.GeneratedMethodAccessor65.invoke(Unknown 
> Source){noformat}
> Under normal circumstances osgi should not invoke any of the 
> updatedPropertyProvider/unbindPropertyProvider methods after the 
> resourceResolverFactory is deactivated - but it has been seen nevertheless.
> What can be done in OakDiscoveryService is to tolerate this and not issue a 
> log.warn instead of throwing an uncaught IllegalArgumentException.
> Edit: more cases with the same root cause:
> {noformat}
> java.lang.Exception: Could not adapt resourceResolver to session: 
> org.apache.sling.resourceresolver.impl.ResourceResolverImpl@3e685b17
>       at 
> org.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteDescriptor.getDescriptorFrom(DiscoveryLiteDescriptor.java:54)
>  [org.apache.sling.discovery.commons:1.0.20]
>       at 
> org.apache.sling.discovery.oak.cluster.OakClusterViewService.getLocalClusterView(OakClusterViewService.java:113)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.base.commons.BaseDiscoveryService.getTopology(BaseDiscoveryService.java:77)
>  [org.apache.sling.discovery.base:2.0.8]
>       at 
> org.apache.sling.discovery.oak.OakDiscoveryService.checkForTopologyChange(OakDiscoveryService.java:660)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.oak.pinger.OakViewChecker.discoveryLiteCheck(OakViewChecker.java:217)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.oak.pinger.OakViewChecker.access$000(OakViewChecker.java:62)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.oak.pinger.OakViewChecker$1.run(OakViewChecker.java:193)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.base.commons.PeriodicBackgroundJob.safelyRun(PeriodicBackgroundJob.java:86)
>  [org.apache.sling.discovery.base:2.0.8]
>       at 
> org.apache.sling.discovery.base.commons.PeriodicBackgroundJob.run(PeriodicBackgroundJob.java:77)
>  [org.apache.sling.discovery.base:2.0.8]
>       at java.base/java.lang.Thread.run(Thread.java:834)
> {noformat}
> {noformat}
> java.lang.Exception: Could not adapt resourceResolver to session: 
> org.apache.sling.resourceresolver.impl.ResourceResolverImpl@215bf7ef
>       at 
> org.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteDescriptor.getDescriptorFrom(DiscoveryLiteDescriptor.java:54)
>  [org.apache.sling.discovery.commons:1.0.20]
>       at 
> org.apache.sling.discovery.oak.TopologyWebConsolePlugin.updateDiscoveryLiteHistory(TopologyWebConsolePlugin.java:778)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.oak.TopologyWebConsolePlugin.handleTopologyEvent(TopologyWebConsolePlugin.java:728)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.commons.providers.base.AsyncTopologyEvent.trigger(AsyncTopologyEvent.java:53)
>  [org.apache.sling.discovery.commons:1.0.20]
>       at 
> org.apache.sling.discovery.commons.providers.base.AsyncEventSender.run(AsyncEventSender.java:118)
>  [org.apache.sling.discovery.commons:1.0.20]
>       at java.base/java.lang.Thread.run(Thread.java:834)
> {noformat}
> {noformat}
> java.lang.Exception: Could not adapt resourceResolver to session: 
> org.apache.sling.resourceresolver.impl.ResourceResolverImpl@4686b1bf
>       at 
> org.apache.sling.discovery.commons.providers.spi.base.DiscoveryLiteDescriptor.getDescriptorFrom(DiscoveryLiteDescriptor.java:54)
>  [org.apache.sling.discovery.commons:1.0.20]
>       at 
> org.apache.sling.discovery.oak.cluster.OakClusterViewService.getLocalClusterView(OakClusterViewService.java:113)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.base.commons.BaseDiscoveryService.getTopology(BaseDiscoveryService.java:77)
>  [org.apache.sling.discovery.base:2.0.8]
>       at 
> org.apache.sling.discovery.oak.OakDiscoveryService.checkForTopologyChange(OakDiscoveryService.java:660)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.oak.pinger.OakViewChecker.discoveryLiteCheck(OakViewChecker.java:217)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.oak.pinger.OakViewChecker.access$000(OakViewChecker.java:62)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.oak.pinger.OakViewChecker$1.run(OakViewChecker.java:193)
>  [org.apache.sling.discovery.oak:1.2.30]
>       at 
> org.apache.sling.discovery.base.commons.PeriodicBackgroundJob.safelyRun(PeriodicBackgroundJob.java:86)
>  [org.apache.sling.discovery.base:2.0.8]
>       at 
> org.apache.sling.discovery.base.commons.PeriodicBackgroundJob.run(PeriodicBackgroundJob.java:77)
>  [org.apache.sling.discovery.base:2.0.8]
>       at java.base/java.lang.Thread.run(Thread.java:834)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to