You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "Aled Sage (JIRA)" <ji...@apache.org> on 2016/05/31 08:30:13 UTC
[jira] [Resolved] (BROOKLYN-285) Dangling reference in
Propagator.producer: can cause subscription to self, and infinite
subscription loop
[ https://issues.apache.org/jira/browse/BROOKLYN-285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aled Sage resolved BROOKLYN-285.
--------------------------------
Resolution: Fixed
Fix Version/s: 0.10.0
> 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)