You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by ahgittin <gi...@git.apache.org> on 2016/08/25 08:15:11 UTC

[GitHub] brooklyn-server pull request #306: don't hold lock on EntityManagementSuppor...

GitHub user ahgittin opened a pull request:

    https://github.com/apache/brooklyn-server/pull/306

    don't hold lock on EntityManagementSupport for longer than needed

    fixes a deadlock observed with a screwy blueprints, when:
    
    "item added" callback:  locking EntityManagementSupport to get subscription context, while updating members
            at org.apache.brooklyn.core.mgmt.internal.EntityManagementSupport.getSubscriptionContext(EntityManagementSupport.java:362)
            - waiting to lock <0x0000000088908188> (a org.apache.brooklyn.core.mgmt.internal.EntityManagementSupport)
            at org.apache.brooklyn.core.entity.AbstractEntity$BasicSubscriptionSupport.getSubscriptionContext(AbstractEntity.java:1519)
            at org.apache.brooklyn.core.entity.AbstractEntity$BasicSensorSupport.emitInternal(AbstractEntity.java:1191)
            at org.apache.brooklyn.core.entity.AbstractEntity$BasicSensorSupport.emit(AbstractEntity.java:1184)
            at org.apache.brooklyn.core.entity.EntityDynamicType.addSensorIfAbsent(EntityDynamicType.java:204)
            at org.apache.brooklyn.core.entity.AbstractEntity$BasicSensorSupport.set(AbstractEntity.java:1093)
            at org.apache.brooklyn.entity.group.AbstractGroupImpl.addMember(AbstractGroupImpl.java:134)
            - locked <0x0000000085f0fa30> (a java.util.LinkedHashSet)
            at org.apache.brooklyn.entity.group.DynamicGroupImpl.onEntityAdded(DynamicGroupImpl.java:126)
            - locked <0x0000000085f0fb28> (a java.lang.Object)
            at org.apache.brooklyn.entity.group.DynamicGroupImpl$MyEntitySetChangeListener.onItemAdded(DynamicGroupImpl.java:154)
    
    publishing on management started, locking members in order to deliver, while handling onManagementStarted
            at org.apache.brooklyn.entity.group.AbstractGroupImpl.getMembers(AbstractGroupImpl.java:269)
            - waiting to lock <0x0000000085f0fa30> (a java.util.LinkedHashSet)
            at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.apache.brooklyn.core.objs.proxy.EntityProxyImpl.invoke(EntityProxyImpl.java:188)
            at com.sun.proxy.$Proxy181.getMembers(Unknown Source)
            at org.apache.brooklyn.core.mgmt.internal.AbstractSubscriptionManager$2.apply(AbstractSubscriptionManager.java:130)
            at org.apache.brooklyn.core.mgmt.internal.AbstractSubscriptionManager$2.apply(AbstractSubscriptionManager.java:128)
            at org.apache.brooklyn.core.mgmt.internal.LocalSubscriptionManager.publish(LocalSubscriptionManager.java:221)
            at org.apache.brooklyn.core.mgmt.internal.QueueingSubscriptionManager.startDelegatingForPublishing(QueueingSubscriptionManager.java:91)
            - locked <0x00000000889016a8> (a org.apache.brooklyn.core.mgmt.internal.QueueingSubscriptionManager)
            at org.apache.brooklyn.core.mgmt.internal.EntityManagementSupport.onManagementStarted(EntityManagementSupport.java:247)
            - locked <0x0000000088908188> (a org.apache.brooklyn.core.mgmt.internal.EntityManagementSupport)
            at org.apache.brooklyn.core.mgmt.internal.LocalEntityManager.manageRecursive(LocalEntityManager.java:392)
            at org.apache.brooklyn.core.mgmt.internal.LocalEntityManager.manage(LocalEntityManager.java:278)
            at org.apache.brooklyn.core.mgmt.internal.LocalEntityManager.createEntity(LocalEntityManager.java:152)
            at org.apache.brooklyn.core.mgmt.EntityManagementUtils.createUnstarted(EntityManagementUtils.java:83)
    
    my blueprint had a static sensor waiting on an attribute from another static sensor, which is possibly why...

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ahgittin/brooklyn-server management-synchronization

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/306.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #306
    
----
commit f0690255ed6a686f7cfad82f04ec4dc3ac22d7a2
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date:   2016-08-24T12:52:22Z

    don't hold lock on EntityManagementSupport for longer than needed
    
    fixes a deadlock observed with a screwy blueprints, when:
    
    "item added" callback:  locking EntityManagementSupport to get subscription context, while updating members
            at org.apache.brooklyn.core.mgmt.internal.EntityManagementSupport.getSubscriptionContext(EntityManagementSupport.java:362)
            - waiting to lock <0x0000000088908188> (a org.apache.brooklyn.core.mgmt.internal.EntityManagementSupport)
            at org.apache.brooklyn.core.entity.AbstractEntity$BasicSubscriptionSupport.getSubscriptionContext(AbstractEntity.java:1519)
            at org.apache.brooklyn.core.entity.AbstractEntity$BasicSensorSupport.emitInternal(AbstractEntity.java:1191)
            at org.apache.brooklyn.core.entity.AbstractEntity$BasicSensorSupport.emit(AbstractEntity.java:1184)
            at org.apache.brooklyn.core.entity.EntityDynamicType.addSensorIfAbsent(EntityDynamicType.java:204)
            at org.apache.brooklyn.core.entity.AbstractEntity$BasicSensorSupport.set(AbstractEntity.java:1093)
            at org.apache.brooklyn.entity.group.AbstractGroupImpl.addMember(AbstractGroupImpl.java:134)
            - locked <0x0000000085f0fa30> (a java.util.LinkedHashSet)
            at org.apache.brooklyn.entity.group.DynamicGroupImpl.onEntityAdded(DynamicGroupImpl.java:126)
            - locked <0x0000000085f0fb28> (a java.lang.Object)
            at org.apache.brooklyn.entity.group.DynamicGroupImpl$MyEntitySetChangeListener.onItemAdded(DynamicGroupImpl.java:154)
    
    publishing on management started, locking members in order to deliver, while handling onManagementStarted
            at org.apache.brooklyn.entity.group.AbstractGroupImpl.getMembers(AbstractGroupImpl.java:269)
            - waiting to lock <0x0000000085f0fa30> (a java.util.LinkedHashSet)
            at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.apache.brooklyn.core.objs.proxy.EntityProxyImpl.invoke(EntityProxyImpl.java:188)
            at com.sun.proxy.$Proxy181.getMembers(Unknown Source)
            at org.apache.brooklyn.core.mgmt.internal.AbstractSubscriptionManager$2.apply(AbstractSubscriptionManager.java:130)
            at org.apache.brooklyn.core.mgmt.internal.AbstractSubscriptionManager$2.apply(AbstractSubscriptionManager.java:128)
            at org.apache.brooklyn.core.mgmt.internal.LocalSubscriptionManager.publish(LocalSubscriptionManager.java:221)
            at org.apache.brooklyn.core.mgmt.internal.QueueingSubscriptionManager.startDelegatingForPublishing(QueueingSubscriptionManager.java:91)
            - locked <0x00000000889016a8> (a org.apache.brooklyn.core.mgmt.internal.QueueingSubscriptionManager)
            at org.apache.brooklyn.core.mgmt.internal.EntityManagementSupport.onManagementStarted(EntityManagementSupport.java:247)
            - locked <0x0000000088908188> (a org.apache.brooklyn.core.mgmt.internal.EntityManagementSupport)
            at org.apache.brooklyn.core.mgmt.internal.LocalEntityManager.manageRecursive(LocalEntityManager.java:392)
            at org.apache.brooklyn.core.mgmt.internal.LocalEntityManager.manage(LocalEntityManager.java:278)
            at org.apache.brooklyn.core.mgmt.internal.LocalEntityManager.createEntity(LocalEntityManager.java:152)
            at org.apache.brooklyn.core.mgmt.EntityManagementUtils.createUnstarted(EntityManagementUtils.java:83)
    
    my blueprint had a static sensor waiting on an attribute from another static sensor, which is possibly why...

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #306: don't hold lock on EntityManagementSupport for l...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the issue:

    https://github.com/apache/brooklyn-server/pull/306
  
    LGTM, merging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server issue #306: don't hold lock on EntityManagementSupport for l...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the issue:

    https://github.com/apache/brooklyn-server/pull/306
  
    @neykov does this look alright to you?  would like to land this week if poss... /cc @aledsage 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] brooklyn-server pull request #306: don't hold lock on EntityManagementSuppor...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/brooklyn-server/pull/306


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---