brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <>
Subject [GitHub] incubator-brooklyn pull request: Fixing jenkins failures
Date Tue, 07 Oct 2014 08:24:16 GMT
Github user aledsage commented on a diff in the pull request:
    --- Diff: core/src/main/java/brooklyn/entity/basic/ ---
    @@ -114,6 +117,21 @@ private ServiceStateLogic() {}
         public static void setExpectedState(Entity entity, Lifecycle state) {
    +        if (state==Lifecycle.RUNNING) {
    +            Boolean up = ((EntityInternal)entity).getAttribute(Attributes.SERVICE_UP);
    +            if (!Boolean.TRUE.equals(up)) {
    +                // pause briefly to allow any recent problem-clearing processing to complete
    +                Stopwatch timer = Stopwatch.createStarted();
    +                boolean nowUp = Repeater.create().every(Duration.millis(10)).limitTimeTo(Duration.millis(200)).until(entity,

    --- End diff --
    I'm always reluctant to add sleeps into the code (even if it is a nicely implemented one
that limits the length of the sleep).
    I prefer the `backOffTo` rather than the `every`, e.g. `.backOffTo(Duration.millis(20))`.
    I'm ok with merging this because it improves the race. But the race still exists, and
may well still bite us on apache jenkins where the machines are low powered so things could
take more than 200ms.

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

View raw message