Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E96D52009C6 for ; Tue, 31 May 2016 10:15:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E806A160A09; Tue, 31 May 2016 08:15:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2FDA2160A23 for ; Tue, 31 May 2016 10:15:14 +0200 (CEST) Received: (qmail 62627 invoked by uid 500); 31 May 2016 08:15:13 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 62595 invoked by uid 99); 31 May 2016 08:15:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2016 08:15:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id EB3D52C1F5C for ; Tue, 31 May 2016 08:15:12 +0000 (UTC) Date: Tue, 31 May 2016 08:15:12 +0000 (UTC) From: "Aled Sage (JIRA)" To: dev@brooklyn.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (BROOKLYN-285) Dangling reference in Propagator.producer: can cause subscription to self, and infinite subscription loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 31 May 2016 08:15:15 -0000 [ https://issues.apache.org/jira/browse/BROOKLYN-285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15307414#comment-15307414 ] Aled Sage commented on BROOKLYN-285: ------------------------------------ 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). We still need to confirm if it is fixed. > 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 > > 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)