brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #211: BROOKLYN-264 Stop app while VM still bein...
Date Wed, 29 Jun 2016 12:38:38 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message