brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grkvlt <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Fix various integration tests
Date Fri, 31 Oct 2014 14:04:30 GMT
Github user grkvlt commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/285#discussion_r19667970
  
    --- Diff: software/nosql/src/main/java/brooklyn/entity/nosql/mongodb/MongoDBReplicaSetImpl.java
---
    @@ -264,16 +275,30 @@ public void run() {
                     Boolean isAvailable = member.getAttribute(MongoDBServer.SERVICE_UP);
                     // Wait for the replica set to elect a new primary if the set is reconfiguring
itself.
                     MongoDBServer primary = getPrimary();
    +                boolean reschedule;
    +                
                     if (primary != null && !isAvailable) {
    -                    primary.removeMemberFromReplicaSet(member);
    -                    if (LOG.isInfoEnabled()) {
    +                    boolean removed = primary.removeMemberFromReplicaSet(member);
    +                    if (removed) {
                             LOG.info("Removed {} from replica set {}", member, getName());
    +                        reschedule = false;
    +                    } else {
    +                        if (LOG.isDebugEnabled()) {
    +                            LOG.debug("{} could not be removed from replica set via {};
rescheduling", member, getName());
    +                        }
    +                        reschedule = true;
                         }
    +
                     } else {
                         if (LOG.isTraceEnabled()) {
                             LOG.trace("Rescheduling removal of member {} from replica set
{}: service_up={}, primary={}",
                                 new Object[]{member, getName(), isAvailable, primary});
                         }
    +                    reschedule = true;
    +                }
    +                
    +                if (reschedule) {
    +                    // TODO Could limit number of retries
                         executor.schedule(this, 3, TimeUnit.SECONDS);
    --- End diff --
    
    Three seconds seems pretty arbitrary. Maybe this should be configurable?


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