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

    https://github.com/apache/brooklyn-server/pull/356#discussion_r81124706
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java ---
    @@ -687,8 +689,13 @@ protected void manageTheObjects() {
             Set<String> oldEntities = 
Sets.newLinkedHashSet(entityManager.getEntityIds());
             for (Entity entity: rebindContext.getEntities()) {
                 ManagementTransitionMode oldMode = 
updateTransitionMode(entityManager, entity);
    -            if (oldMode!=null)
    +            if (oldMode!=null) {
                     oldEntities.remove(entity.getId());
    +            }
    +
    +            if (ServiceStateLogic.getExpectedState(entity) == 
Lifecycle.STARTING || ServiceStateLogic.getExpectedState(entity) == 
Lifecycle.STOPPING) {
    --- End diff --
    
    I think this call needs to be guarded so it's not called by a HOT_STANDBY 
Brooklyn server (i.e. a read-only view) etc. We only want to set this if this 
entity is in `BrooklynObjectManagementMode.MANAGED_PRIMARY`.
    
    (Note that is not the `oldMode`; it is the new mode that we care about).
    
    I therefore wonder if there is a better place for this code. I'll dig 
around and see.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to