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

    https://github.com/apache/brooklyn-server/pull/211#discussion_r68937820
  
    --- Diff: 
software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java
 ---
    @@ -709,7 +713,24 @@ protected void doStop(ConfigBag parameters, 
Callable<StopMachineDetails<Integer>
     
             DynamicTasks.queue("pre-stop", new PreStopCustomTask());
     
    +        // BROOKLYN-263:
    +        // With this change the stop effector will always wait for 
machinelocation to provision, so it can stop it.
    +        // However in some situations if the stop effector is called in 
less than 8 seconds after start was called,
    +        // it may be safe to skip this wait and proceed with stop.
    +        // Hesitant about parameterising this.
             Maybe<MachineLocation> machine = 
Machines.findUniqueMachineLocation(entity().getLocations());
    +        /*Do not retry if non-jclouds location has started.*/
    +        if 
(Boolean.TRUE.equals(entity().sensors().get(Sensors.newBooleanSensor("jclouds.provisioningStarted")))
    +                && machine.isAbsent()) {
    +            org.jclouds.util.Predicates2.retry(new 
Predicate<MachineLifecycleEffectorTasks>() {
    --- End diff --
    
    It feels like you should use our existing 
`org.apache.brooklyn.util.repeat.Repeater`. My personal opinion is that the 
builder pattern for the Repeater is easier to read, compared to the 
`Predicates2.retry` approach. The latter is probably only a good idea when you 
want to pass it to something that expects a `Predicate`.


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