Permalink
Browse files

Skipping reconnect when not in cluster anymore.

This changeset skips the reconnect phase when the to be
reconnected node is not part of the cluster anymore. This
information is based on the locator.

Change-Id: I949ec1e78fd6b5fa73851d5461cbf3a70de11027
Reviewed-on: http://review.couchbase.org/24232
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  • Loading branch information...
daschl committed Jan 28, 2013
1 parent 65cf4b0 commit 6e8c47d38c178cf6e3d763c625ed0be08102e246
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/main/java/net/spy/memcached/MemcachedConnection.java
@@ -658,6 +658,11 @@ private void attemptReconnects() throws IOException {
final MemcachedNode qa = i.next();
i.remove();
try {
+ if(!belongsToCluster(qa)) {
+ getLogger().debug("Node does not belong to cluster anymore, "
+ + "skipping reconnect: %s", qa);
+ continue;
+ }
if (!seen.containsKey(qa)) {
seen.put(qa, Boolean.TRUE);
getLogger().info("Reconnecting %s", qa);

0 comments on commit 6e8c47d

Please sign in to comment.