Github user aledsage commented on the pull request:
https://github.com/apache/brooklyn-server/pull/148#issuecomment-222102968
This looks good, but I think the `log.warn` is too extreme:
For example, if you deploy this simple blueprint:
location: localhost
services:
- type: org.apache.brooklyn.entity.group.DynamicCluster
brooklyn.config:
cluster.initial.size: 1
memberSpec:
$brooklyn:entitySpec:
type:
org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
Then it logs:
2016-05-27 10:02:17,140 WARN Adding location
LocalhostMachineProvisioningLocation{id=mB4Tjwyt, name=localhost} to entity
EmptySoftwareProcessImpl{id=iVSKZf22} which is already owner by another entity
xUAFEbnM. Locations which are owned by a specific entity should not be shared
with other entities as they will be unmanaged together with their owner,
regardless of other references to them.
This is because the `MachineProvisionigLocation` is passed by the app to
the child SoftwareProcess. But it is already owned by the app. The
DynamicCluster passes the location via `entity.start(location)`.
Note that we don't get this log message if we were just using a simple app
+ entity (rather than a dynamically resized `DynamicCluster`). This is because
the location would be passed differently to the child entity: in
`MachineLifecycleEffectorTasks.getLocation`, it finds the location from its
ancestor rather than calling `addLocations()`.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---