Skip to content

Commit

Permalink
SPY-182: Avoid WARN logging when handling node not set.
Browse files Browse the repository at this point in the history
Motivation
----------
The main purpose of setting a continous timeout on a node is to
properly reconnect when the threshold is reached. Now if auth
has not happened yet, it could be that ops do not have a handling
node set yet.

In those cases, it doesn't make any sense to increase the counter,
so it should be ignored. This also has the side effect of not logging
warnings to the user which have no impact for him.

Modifications
-------------
Ignore the operation when its handling node is not set.

Result
------
No unnecessary warnings printed to the user.

Change-Id: I3643d5e0bfc7474889279d0f8362f287624b89a3
Reviewed-on: http://review.couchbase.org/45131
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Simon Baslé <simon@couchbase.com>
  • Loading branch information
daschl authored and Michael Nitschinger committed Jan 9, 2015
1 parent 7918946 commit f896fd5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/net/spy/memcached/MemcachedConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,10 @@ public static void opSucceeded(final Operation op) {
}

/**
* Set the continous timeout on an operation.
* Set the continuous timeout on an operation.
*
* Ignore operations which have no handling nodes set yet (which may happen before nodes are properly
* authenticated).
*
* @param op the operation to use.
* @param isTimeout is timed out or not.
Expand All @@ -1413,9 +1416,7 @@ private static void setTimeout(final Operation op, final boolean isTimeout) {
}

MemcachedNode node = op.getHandlingNode();
if (node == null) {
logger.warn("handling node for operation is not set");
} else {
if (node != null) {
node.setContinuousTimeout(isTimeout);
}
} catch (Exception e) {
Expand Down

0 comments on commit f896fd5

Please sign in to comment.