Updating remoteRPC logging for better debugging. 20/23620/2
authorHarman Singh <harmasin@cisco.com>
Tue, 30 Jun 2015 23:56:45 +0000 (16:56 -0700)
committerHarman Singh <harmasin@cisco.com>
Wed, 1 Jul 2015 00:39:24 +0000 (17:39 -0700)
Moving Gossip ticks to trace because it happens very frequently.

Change-Id: I8e664b79fbf12a6b45b8483da8940ed8e0be9cac
Signed-off-by: Harman Singh <harmasin@cisco.com>
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RpcBroker.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Gossiper.java

index 0c5315c..55de22e 100644 (file)
@@ -12,6 +12,7 @@ import akka.actor.ActorRef;
 import akka.actor.Props;
 import akka.japi.Creator;
 import com.google.common.base.Preconditions;
+import com.google.common.base.Throwables;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
@@ -95,7 +96,11 @@ public class RpcBroker extends AbstractUntypedActor {
 
                 @Override
                 public void onFailure(final Throwable t) {
-                    LOG.error("executeRpc for {} failed: {}", msg.getRpc(), t);
+                    LOG.error("executeRpc for {} failed with root cause: {}. For exception details, enable Debug logging.",
+                        msg.getRpc(), Throwables.getRootCause(t));
+                    if(LOG.isDebugEnabled()) {
+                        LOG.debug("Detailed exception for execute RPC failure :{}", t);
+                    }
                     sender.tell(new akka.actor.Status.Failure(t), self);
                 }
             });
index 8af1c83..e45950d 100644 (file)
@@ -210,8 +210,8 @@ public class Gossiper extends AbstractUntypedActorWithMetering {
             Integer randomIndex = ThreadLocalRandom.current().nextInt(0, clusterMembers.size());
             remoteMemberToGossipTo = clusterMembers.get(randomIndex);
         }
-        if(log.isDebugEnabled()) {
-            log.debug("Gossiping to [{}]", remoteMemberToGossipTo);
+        if(log.isTraceEnabled()) {
+            log.trace("Gossiping to [{}]", remoteMemberToGossipTo);
         }
         getLocalStatusAndSendTo(remoteMemberToGossipTo);
     }
@@ -251,8 +251,8 @@ public class Gossiper extends AbstractUntypedActorWithMetering {
     void receiveGossip(GossipEnvelope envelope){
         //TODO: Add more validations
         if (!selfAddress.equals(envelope.to())) {
-            if(log.isDebugEnabled()) {
-                log.debug("Ignoring message intended for someone else. From [{}] to [{}]", envelope.from(), envelope.to());
+            if(log.isTraceEnabled()) {
+                log.trace("Ignoring message intended for someone else. From [{}] to [{}]", envelope.from(), envelope.to());
             }
             return;
         }
@@ -300,8 +300,8 @@ public class Gossiper extends AbstractUntypedActorWithMetering {
         ActorSelection remoteRef = getContext().system().actorSelection(
                 remoteActorSystemAddress.toString() + getSelf().path().toStringWithoutAddress());
 
-        if(log.isDebugEnabled()) {
-            log.debug("Sending bucket versions to [{}]", remoteRef);
+        if(log.isTraceEnabled()) {
+            log.trace("Sending bucket versions to [{}]", remoteRef);
         }
 
         futureReply.map(getMapperToSendLocalStatus(remoteRef), getContext().dispatcher());
@@ -431,8 +431,8 @@ public class Gossiper extends AbstractUntypedActorWithMetering {
             public Void apply(Object msg) {
                 if (msg instanceof GetBucketsByMembersReply) {
                     Map<Address, Bucket> buckets = ((GetBucketsByMembersReply) msg).getBuckets();
-                    if(log.isDebugEnabled()) {
-                        log.debug("Buckets to send from {}: {}", selfAddress, buckets);
+                    if(log.isTraceEnabled()) {
+                        log.trace("Buckets to send from {}: {}", selfAddress, buckets);
                     }
                     GossipEnvelope envelope = new GossipEnvelope(selfAddress, sender.path().address(), buckets);
                     sender.tell(envelope, getSelf());

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.