paulrutter commented on PR #236:
URL: https://github.com/apache/felix-dev/pull/236#issuecomment-2480687669

   > @paulrutter ,
   > 
   > > I assume this PR just starts the OSGi bundles in parallel, where the 
above starts the services in these bundles in parallel, correct?
   > 
   > Hi Paul,
   > 
   > yes, you are correct, when DM is used in concurrent mode, then services 
are all started and registered concurrently, so concurrency is achieved at the 
service level.
   > 
   > now, about the exception you reported:
   > 
   > > Caused by: java.lang.ExceptionInInitializerError: Exception 
java.lang.NullPointerException [in thread "pool-3-thread-1"]
   > > at 
org.apache.felix.dm.impl.index.ServiceRegistryCacheManager.init(ServiceRegistryCacheManager.java:140)
   > > at 
org.apache.felix.dm.impl.index.ServiceRegistryCacheManager.(ServiceRegistryCacheManager.java:63)
   > > at 
org.apache.felix.dm.DependencyManager.createContext(DependencyManager.java:314)
   > > at org.apache.felix.dm.DependencyManager.(DependencyManager.java:88)
   > > at 
org.apache.felix.dm.DependencyActivatorBase.start(DependencyActivatorBase.java:77)
   > > at 
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:849)
   > > at org.apache.felix.framework.Felix.activateBundle(Felix.java:2429)
   > > at org.apache.felix.framework.Felix.startBundle(Felix.java:2335)
   > > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:1006)
   > > at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:992)
   > > at 
org.apache.felix.main.AutoProcessor.lambda$processAutoProperties$2(AutoProcessor.java:376)
   > > at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
   > > at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
   > > ... 1 more
   > 
   > after many attempts, I confirm that I also reproduced the problem. I'm not 
using DM in parallel mode, and I have recompiled the framework from this PR 
branch. I'm using 117 bundles, on mac M1 with 8 cpus. The issue is hard to 
reproduce.
   > 
   > So, from the stacktrace, we have a NPE in this 
[location](https://github.com/apache/felix-dev/blob/master/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/index/ServiceRegistryCacheManager.java#L140),
 meaning that in the previous line 
([here](https://github.com/apache/felix-dev/blob/master/dependencymanager/org.apache.felix.dependencymanager/src/org/apache/felix/dm/impl/index/ServiceRegistryCacheManager.java#L139)),
 `bundle.getBundleContext();` has returned null.
   > 
   > I cannot comment on this for the moment.
   
   I don't know what causes this, but maybe adding a while loop on the 
bundleContext being non null with a thread.sleep(100) would resolve this 
intermittent timing issue?
   Then again, there might be more places where there could occur similar 
timing issues.
   What do you think would be the best approach? The reason I'm interested in 
this is that we experienced the exact same issue sporadically when 
experimenting with parallel startup via the DM (hence the script i had laying 
around). 


-- 
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...@felix.apache.org

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

Reply via email to