You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Robert Varga (Jira)" <ji...@apache.org> on 2020/07/28 07:00:00 UTC

[jira] [Comment Edited] (FELIX-6048) Could not obtain lock

    [ https://issues.apache.org/jira/browse/FELIX-6048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17166197#comment-17166197 ] 

Robert Varga edited comment on FELIX-6048 at 7/28/20, 6:59 AM:
---------------------------------------------------------------

I do not have a ready reproducer yet, but we've hit this with 2.1.20:
{noformat}
Caused by: java.lang.IllegalStateException: Could not obtain lock
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainLock(AbstractComponentManager.java:241) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainStateLock(AbstractComponentManager.java:288) ~[?:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:890) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) ~[?:?]{noformat}
Full log is here:

[https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/serviceutils-maven-merge-aluminium/170/features/odl-serviceutils-srm/target/SFT/karaf.log.gz]

From what I gather, it seems the component is being accessed via Service Registry while its activate() method is still executing:
{code:java}
2020-07-28T06:08:43,325 | INFO  | features-3-thread-1 | OSGiActorSystemProvider          | 138 - org.opendaylight.controller.sal-distributed-datastore - 2.0.3 | Actor System provider starting
[...]
2020-07-28T06:08:52,435 | ERROR | Blueprint Extender: 1 | ServiceRecipe                    | 19 - org.apache.aries.blueprint.core - 1.10.2 | Error retrieving service from ServiceRecipe[name='.component-1']
org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean configDatastore of class org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory
[...]
Caused by: java.lang.IllegalStateException: getService() returned null for {org.opendaylight.controller.cluster.ActorSystemProvider}={service.id=1951, service.bundleid=138, service.scope=bundle, component.name=org.opendaylight.controller.cluster.akka.osgi.impl.OSGiActorSystemProvider, component.id=25}
[...]
2020-07-28T06:08:52,548 | ERROR | Framework Event Dispatcher: org.eclipse.osgi.internal.framework.EquinoxEventPublisher@7905a0b8 | FrameworkEvent                   | 138 - org.opendaylight.controller.sal-distributed-datastore - 2.0.3 | FrameworkEvent ERROR
org.osgi.framework.ServiceException: Exception in org.apache.felix.scr.impl.manager.SingleComponentManager.getService()
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:222) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:508) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461) ~[?:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:624) ~[?:?]
[...]
Caused by: java.lang.IllegalStateException: Could not obtain lock
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainLock(AbstractComponentManager.java:241) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainStateLock(AbstractComponentManager.java:288) ~[?:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:890) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) ~[?:?]
	... 48 more
[...]
2020-07-28T06:08:58,971 | INFO  | features-3-thread-1 | OSGiActorSystemProvider          | 138 - org.opendaylight.controller.sal-distributed-datastore - 2.0.3 | Actor System provider started
{code}


was (Author: nite):
I do not have a ready reproducer yet, but we've hit this with 2.1.20:
{noformat}
Caused by: java.lang.IllegalStateException: Could not obtain lock
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainLock(AbstractComponentManager.java:241) ~[?:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainStateLock(AbstractComponentManager.java:288) ~[?:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:890) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212) ~[?:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210) ~[?:?]{noformat}
Full log is here:

[https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/serviceutils-maven-merge-aluminium/170/features/odl-serviceutils-srm/target/SFT/karaf.log.gz]

From what I gather, it seems the component is being accessed via Service Registry while its activate() method is still executing:
{code:java}
2020-07-28T06:08:43,325 | INFO  | features-3-thread-1 | OSGiActorSystemProvider          | 138 - org.opendaylight.controller.sal-distributed-datastore - 2.0.3 | Actor System provider starting
[...]
2020-07-28T06:08:52,435 | ERROR | Blueprint Extender: 1 | ServiceRecipe                    | 19 - org.apache.aries.blueprint.core - 1.10.2 | Error retrieving service from ServiceRecipe[name='.component-1']
org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean configDatastore of class org.opendaylight.controller.cluster.datastore.DistributedDataStoreFactory
[...]
Caused by: java.lang.IllegalStateException: getService() returned null for {org.opendaylight.controller.cluster.ActorSystemProvider}={service.id=1951, service.bundleid=138, service.scope=bundle, component.name=org.opendaylight.controller.cluster.akka.osgi.impl.OSGiActorSystemProvider, component.id=25}
[...]
2020-07-28T06:08:58,971 | INFO  | features-3-thread-1 | OSGiActorSystemProvider          | 138 - org.opendaylight.controller.sal-distributed-datastore - 2.0.3 | Actor System provider started
{code}

> Could not obtain lock
> ---------------------
>
>                 Key: FELIX-6048
>                 URL: https://issues.apache.org/jira/browse/FELIX-6048
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-2.1.14
>            Reporter: Alain Picard
>            Priority: Minor
>         Attachments: Felix no lock.png
>
>
> I regularly get this exception when starting our app, w/o having ever seen any impact.
>  
> {code:java}
> !ENTRY org.eclipse.equinox.cm 4 0 2019-02-02 14:31:46.715
> !MESSAGE Could not obtain lock
> !STACK 0
> java.lang.IllegalStateException: Could not obtain lock
>     at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainLock(AbstractComponentManager.java:231)
>     at org.apache.felix.scr.impl.manager.AbstractComponentManager.obtainActivationWriteLock(AbstractComponentManager.java:266)
>     at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:633)
>     at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:609)
>     at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:426)
>     at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:284)
>     at org.apache.felix.scr.impl.manager.RegionConfigurationSupport$1.configurationEvent(RegionConfigurationSupport.java:89)
>     at org.eclipse.equinox.internal.cm.EventDispatcher$1.run(EventDispatcher.java:89)
>     at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36)
> After reporting on OSGI forum, was suggested to report here.{code}



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