In our application, I am seeing below stack trace when doing performance test. The HTTP call /content/myproduct.product-details.json is executed multiple times.
"10.43.0.54 [1622796489658] GET /content/myproduct.product-details.json HTTP/1.1" #38568
prio=5 os_prio=0 cpu=1873.84ms elapsed=520.13s tid=0x00007f9d40ec3800 nid=0xe20 waiting
for monitor entry [0x00007f9d10dd7000]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.apache.felix.framework.EventDispatcher.updateListener(EventDispatcher.java:397)
- waiting to lock <0x00000007143ec440> (a org.apache.felix.framework.EventDispatcher)
at org.apache.felix.framework.EventDispatcher.addListener(EventDispatcher.java:183)
at org.apache.felix.framework.Felix.addServiceListener(Felix.java:3615)
at org.apache.felix.framework.BundleContextImpl.addServiceListener(BundleContextImpl.java:259)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:297)
- locked <0x00000007bce37348> (a org.osgi.util.tracker.ServiceTracker$Tracked)
- locked <0x00000007bce372a8> (a org.osgi.util.tracker.ServiceTracker)
at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:264)
at org.apache.jackrabbit.oak.osgi.OsgiWhiteboard.track(OsgiWhiteboard.java:160)
at org.apache.jackrabbit.oak.osgi.OsgiWhiteboard.track(OsgiWhiteboard.java:112)
at org.apache.jackrabbit.oak.osgi.OsgiWhiteboard.track(OsgiWhiteboard.java:107)
at org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.getService(WhiteboardUtils.java:197)
at org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardUtils.getService(WhiteboardUtils.java:145)
at org.apache.jackrabbit.oak.security.user.UserConfigurationImpl.getBlobAccessProvider(UserConfigurationImpl.java:276)
at org.apache.jackrabbit.oak.security.user.UserConfigurationImpl.getUserManager(UserConfigurationImpl.java:251)
at org.apache.jackrabbit.oak.security.authentication.token.TokenProviderImpl. (TokenProviderImpl.java:138)
at org.apache.jackrabbit.oak.security.authentication.token.TokenConfigurationImpl.getTokenProvider(TokenConfigurationImpl.java:162)
at org.apache.jackrabbit.oak.spi.security.authentication.token.CompositeTokenConfiguration$1.apply(CompositeTokenConfiguration.java:46)
at org.apache.jackrabbit.oak.spi.security.authentication.token.CompositeTokenConfiguration$1.apply(CompositeTokenConfiguration.java:43)
The servlet (/content/myproduct.product-details.json) is trying to get product details by creating a service resource resolver object on each request. As per my understanding, every time when I get service resource resolver object then a resource resolver thread is executed and during this process OSGI container needs to know how to communicate with different bundles as per whiteboard pattern. And because of this HTTP thread is waitig to lock org.apache.felix.framework.EventDispatcher object.
Could you please let me know whether my understanding is correct or not? And why HTTP thread is not able to accquire the lock on the EventDispatcher object?