brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [2/2] brooklyn-server git commit: Closes #306
Date Thu, 25 Aug 2016 15:14:34 GMT
Closes #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...


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/2efbd86b
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/2efbd86b
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/2efbd86b

Branch: refs/heads/master
Commit: 2efbd86beaacc23b6db42b9518f25ef133aaf4ee
Parents: 1855c07 f069025
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Thu Aug 25 18:14:22 2016 +0300
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Thu Aug 25 18:14:22 2016 +0300

----------------------------------------------------------------------
 .../mgmt/internal/EntityManagementSupport.java  | 33 ++++++++++----------
 1 file changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------



Mime
View raw message