brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aled Sage (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (BROOKLYN-285) Dangling reference in Propagator.producer: can cause subscription to self, and infinite subscription loop
Date Tue, 31 May 2016 08:30:12 GMT

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

Aled Sage edited comment on BROOKLYN-285 at 5/31/16 8:29 AM:
-------------------------------------------------------------

This behaviour has already been changed in Brooklyn master, as a result of fixing https://issues.apache.org/jira/browse/BROOKLYN-278
(see https://github.com/apache/brooklyn-server/pull/154).

Confirmed that we do not get the badly configured Propagator after restart, when using master.
Instead we get in the log:

{noformat}
2016-05-31 09:24:13,073 WARN  o.a.b.c.m.r.RebindExceptionHandlerImpl [brooklyn-execmanager-F0MmZOiD-0]:
problem adding enricher vc7zynhgqd (Propagator{name=org.apache.brooklyn.enricher.stock.Propagator,
running=true, entity=BasicApplicationImpl{id=lijns46k55}, id=vc7zyn
hgqd}) to entity lijns46k55 (BasicApplicationImpl{id=lijns46k55}); continuing
java.lang.IllegalStateException: Propagator enricher Propagator{name=org.apache.brooklyn.enricher.stock.Propagator,
running=true, entity=BasicApplicationImpl{id=lijns46k55}, id=vc7zynhgqd} missing config 'enricher.producer
        at org.apache.brooklyn.enricher.stock.Propagator.setEntity(Propagator.java:103) ~[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.entity.AbstractEntity$BasicEnricherSupport.add(AbstractEntity.java:1768)
~[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.BasicEntityRebindSupport.addEnrichers(BasicEntityRebindSupport.java:145)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.BasicEntityRebindSupport.addEnrichers(BasicEntityRebindSupport.java:47)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.associateAdjunctsWithEntities(RebindIteration.java:649)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.doRun(RebindIteration.java:243)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.InitialFullRebindIteration.doRun(InitialFullRebindIteration.java:69)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.run(RebindIteration.java:265)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl.rebindImpl(RebindManagerImpl.java:558)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:508)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:506)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:519)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_71]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_71]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_71]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
{noformat}

This means the enricher has been created, but because {{propagator.setEntity(entity)}} failed,
it has not created any of its subscriptions.


was (Author: aled.sage):
This behaviour has likely already been changed in Brooklyn master, as a result of fixing https://issues.apache.org/jira/browse/BROOKLYN-278
(see https://github.com/apache/brooklyn-server/pull/154).

Confirmed that we do not get the badly configured Propagator after restart, when using master.
Instead we get in the log:

{noformat}
2016-05-31 09:24:13,073 WARN  o.a.b.c.m.r.RebindExceptionHandlerImpl [brooklyn-execmanager-F0MmZOiD-0]:
problem adding enricher vc7zynhgqd (Propagator{name=org.apache.brooklyn.enricher.stock.Propagator,
running=true, entity=BasicApplicationImpl{id=lijns46k55}, id=vc7zyn
hgqd}) to entity lijns46k55 (BasicApplicationImpl{id=lijns46k55}); continuing
java.lang.IllegalStateException: Propagator enricher Propagator{name=org.apache.brooklyn.enricher.stock.Propagator,
running=true, entity=BasicApplicationImpl{id=lijns46k55}, id=vc7zynhgqd} missing config 'enricher.producer
        at org.apache.brooklyn.enricher.stock.Propagator.setEntity(Propagator.java:103) ~[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.entity.AbstractEntity$BasicEnricherSupport.add(AbstractEntity.java:1768)
~[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.BasicEntityRebindSupport.addEnrichers(BasicEntityRebindSupport.java:145)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.BasicEntityRebindSupport.addEnrichers(BasicEntityRebindSupport.java:47)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.associateAdjunctsWithEntities(RebindIteration.java:649)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.doRun(RebindIteration.java:243)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.InitialFullRebindIteration.doRun(InitialFullRebindIteration.java:69)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.run(RebindIteration.java:265)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl.rebindImpl(RebindManagerImpl.java:558)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:508)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:506)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:519)
[org.apache.brooklyn-brooklyn-core-0.10.0-SNAPSHOT.jar:0.10.0-SNAPSHOT]
        at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_71]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_71]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_71]
        at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
{noformat}

This means the enricher has been created, but because {{propagator.setEntity(entity)}} failed,
it has not created any of its subscriptions.

> Dangling reference in Propagator.producer: can cause subscription to self, and infinite
subscription loop
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: BROOKLYN-285
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-285
>             Project: Brooklyn
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Aled Sage
>             Fix For: 0.10.0
>
>
> When the "producer" entity of a Propagator enricher is unmanaged, it can cause rebind
to resolve the dangling reference value as {{null}}. In 0.9.0, that is treated as the producer
being "self". This can cause an infinite loop, where the Propagator subscribes to its own
sensor, and every time its sensor changes it resets the sensor value.
> To reproduce, deploy this app:
> {noformat}
> location: localhost
> services:
> - type: org.apache.brooklyn.entity.stock.BasicApplication
>   brooklyn.children:
>   - type: org.apache.brooklyn.entity.machine.MachineEntity
> {noformat}
> And programmatically add a Propagator enricher to the top-level app, such as:
> {noformat}
> appId = "u4VDoIOa";
> childId = "LPYT4g27";
> sensor = org.apache.brooklyn.core.sensor.Sensors.newSensor(String.class, "host.name");
> app = mgmt.getEntityManager().getEntity(appId);
> child = mgmt.getEntityManager().getEntity(childId);
> app.enrichers().add(org.apache.brooklyn.api.sensor.EnricherSpec.create(org.apache.brooklyn.enricher.stock.Propagator.class)
>     .configure("enricher.producer", child)
>     .configure("enricher.propagating.inclusions", com.google.common.collect.ImmutableList.of(sensor)));
> {noformat}
> Then unmanange the child entity (e.g. via the advanced tab in the web-console), and restart
Brooklyn.
> The CPU goes through the roof, and the debug log shows log messages like:
> {noformat}
> 2016-05-31 09:02:22,599 DEBUG o.a.b.c.m.i.LocalSubscriptionManager [brooklyn-execmanager-gfOvVoKq-3]:
388000 events for subscriber Subscription[qF9YFEBA;BasicApplicationImpl{id=u4VDoIOa}@u4VDoIOa:host.name]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message