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

    https://github.com/apache/brooklyn-server/pull/452#discussion_r89102968
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogic.java
 ---
    @@ -278,14 +276,18 @@ public void setEntity(EntityLocal entity) {
                     suppressDuplicates = true;
                 }
                 
    -            subscriptions().subscribe(entity, SERVICE_PROBLEMS, this);
    -            subscriptions().subscribe(entity, SERVICE_UP, this);
    -            subscriptions().subscribe(entity, SERVICE_STATE_EXPECTED, 
this);
    -            onEvent(null);
    +            Map<String, ?> notifyOfInitialValue = 
ImmutableMap.of("notifyOfInitialValue", Boolean.TRUE);
    +            subscriptions().subscribe(notifyOfInitialValue, entity, 
SERVICE_PROBLEMS, this);
    --- End diff --
    
    Looks good. My only slight concern is what happens when `SERVICE_PROBLEMS` 
has not been set - we then won't get a callback.
    
    However, I think that's fine because we should still get a callback for the 
initial value of service_up and/or service_state_expected. If those are both 
unset as well, then we shouldn't be marking ourselves as on-fire or healthy, so 
it's right that we didn't try to compute anything until one of those triggers 
us.
    
    So I've convinced myself that this is going to work :-)


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