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

Timothee Maret updated SLING-9029:
----------------------------------
    Summary: PackageQueuedNotifier throws NPE for packages managed by an other 
type of agents   (was: Warning logged by PackageQueuedNotifier if a 
DistributionPackage does not exist in the callback map)

> PackageQueuedNotifier throws NPE for packages managed by an other type of 
> agents 
> ---------------------------------------------------------------------------------
>
>                 Key: SLING-9029
>                 URL: https://issues.apache.org/jira/browse/SLING-9029
>             Project: Sling
>          Issue Type: Bug
>          Components: Content Distribution
>            Reporter: Mohit Arora
>            Assignee: Timothee Maret
>            Priority: Major
>             Fix For: Content Distribution Journal Core 0.1.8
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> [PackageQueuedNotifier.java|https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/master/src/main/java/org/apache/sling/distribution/journal/impl/publisher/PackageQueuedNotifier.java#L66]
>  handles all the {{DistributionEventTopics.AGENT_PACKAGE_QUEUED}} events and 
> try to remove the distribution package associated with the event from a 
> callback map which does not contain the package as the map is populated only 
> in case of [journal based 
> distribution|https://github.com/apache/sling-org-apache-sling-distribution-journal/blob/master/src/main/java/org/apache/sling/distribution/journal/impl/publisher/DistributionPublisher.java#L314]
>  but the event is thrown in general from 
> [QueueingDistributionPackageProcessor.java|https://github.com/apache/sling-org-apache-sling-distribution-core/blob/master/src/main/java/org/apache/sling/distribution/agent/impl/QueueingDistributionPackageProcessor.java#L128]
>  which can be called for a normal end to end distribution without using the 
> kafka pipeline and the journal flow.
> In such a case, a warning like below is logged - 
> {code}07.01.2020 10:10:35.831 *WARN* [FelixLogListener] 
> org.apache.felix.eventadmin Service 
> [org.apache.sling.distribution.journal.impl.publisher.PackageQueuedNotifier,2499,
>  [org.apache.sling.distribution.journal.impl.publisher.PackageQueuedNotifier, 
> org.osgi.service.event.EventHandler]] EventAdmin: Exception during event 
> dispatch [org.osgi.service.event.Event 
> [topic=org/apache/sling/distribution/agent/package/queued] 
> {distribution.type=ADD, distribution.component.name=bpuitestingtenant0, 
> distribution.component.kind=AGENT, 
> distribution.paths=[Ljava.lang.String;@5dd0dbd0} | 
> [org.apache.sling.distribution.journal.impl.publisher.PackageQueuedNotifier, 
> org.osgi.service.event.EventHandler] | 
> Bundle(org.apache.sling.distribution.journal [527])] 
> (java.lang.NullPointerException)
> java.lang.NullPointerException: null
>       at 
> java.base/java.util.concurrent.ConcurrentHashMap.replaceNode(ConcurrentHashMap.java:1111)
>       at 
> java.base/java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:1102)
>       at 
> org.apache.sling.distribution.journal.impl.publisher.PackageQueuedNotifier.handleEvent(PackageQueuedNotifier.java:66)
>  [org.apache.sling.distribution.journal:0.1.6]
>       at 
> org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415)
>  [org.apache.felix.eventadmin:1.5.0]
>       at 
> org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82)
>  [org.apache.felix.eventadmin:1.5.0]
>       at 
> org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104)
>  [org.apache.felix.eventadmin:1.5.0]
>       at 
> org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166)
>  [org.apache.felix.eventadmin:1.5.0]
>       at 
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
>       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>       at 
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
>       at 
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
>       at java.base/java.lang.Thread.run(Thread.java:834){code}
> Ideally, there should be different event(s) generated for different types of 
> distribution.
> cc - [~ashishc], [~marett]



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

Reply via email to