Github user m4rkmckenna commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/782#discussion_r130405300
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/mgmt/internal/LocalEntityManager.java
 ---
    @@ -670,23 +694,26 @@ private synchronized boolean 
manageNonRecursive(Entity e, ManagementTransitionMo
             Entity old = entitiesById.get(e.getId());
             
             if (old!=null && mode.wasNotLoaded()) {
    -            if (old.equals(e)) {
    +            if (old == deproxyIfNecessary(e)) {
                     log.warn("{} redundant call to start management of entity 
{}; ignoring", this, e);
                 } else {
    -                throw new IllegalStateException("call to manage entity 
"+e+" ("+mode+") but different entity "+old+" already known under that id at 
"+this);
    +                throw new IdAlreadyExistsException("call to manage entity 
"+e+" ("+mode+") but "
    +                        + "different entity "+old+" already known under 
that id '"+e.getId()+"' at "+this);
                 }
                 return false;
             }
     
             BrooklynLogging.log(log, 
BrooklynLogging.levelDebugOrTraceIfReadOnly(e),
    -            "{} starting management of entity {}", this, e);
    +                "{} starting management of entity {}", this, e);
             Entity realE = toRealEntity(e);
             
             Entity oldProxy = entityProxiesById.get(e.getId());
             Entity proxyE;
             if (oldProxy!=null) {
                 if (mode.wasNotLoaded()) {
    -                throw new IllegalStateException("call to manage entity 
"+e+" from unloaded state ("+mode+") but already had proxy "+oldProxy+" already 
known under that id at "+this);
    +                throw new IdAlreadyExistsException("call to manage entity 
"+e+" from unloaded "
    --- End diff --
    
    As above the exception text isnt returned so hard to recover from from


---
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.
---

Reply via email to