zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From si...@apache.org
Subject svn commit: r1575793 - in /zookeeper/bookkeeper/branches/branch-4.2: CHANGES.txt bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java
Date Mon, 10 Mar 2014 02:07:04 GMT
Author: sijie
Date: Mon Mar 10 02:07:03 2014
New Revision: 1575793

URL: http://svn.apache.org/r1575793
Log:
BOOKKEEPER-714: Logging channel exceptions in PerChannelBookieClient (sijie)

Modified:
    zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt
    zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java

Modified: zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt?rev=1575793&r1=1575792&r2=1575793&view=diff
==============================================================================
--- zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt (original)
+++ zookeeper/bookkeeper/branches/branch-4.2/CHANGES.txt Mon Mar 10 02:07:03 2014
@@ -14,6 +14,8 @@ Release 4.2.3 - 2013-12-04
 
         BOOKKEEPER-602: we should have request timeouts rather than channel timeout in PerChannelBookieClient
(Aniruddha via sijie)
 
+        BOOKKEEPER-714: Logging channel exceptions in PerChannelBookieClient (sijie)
+
 Release 4.2.2 - 2013-10-02
 
   Backward compatible changes:

Modified: zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java?rev=1575793&r1=1575792&r2=1575793&view=diff
==============================================================================
--- zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java
(original)
+++ zookeeper/bookkeeper/branches/branch-4.2/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/PerChannelBookieClient.java
Mon Mar 10 02:07:03 2014
@@ -19,16 +19,14 @@ package org.apache.bookkeeper.proto;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
+import java.nio.channels.ClosedChannelException;
 import java.util.ArrayDeque;
-import java.util.Set;
-import java.util.Collections;
 import java.util.Queue;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 
-import com.google.common.collect.ImmutableSet;
 import org.apache.bookkeeper.client.BKException;
 import org.apache.bookkeeper.conf.ClientConfiguration;
 import org.apache.bookkeeper.proto.BookieProtocol.PacketHeader;
@@ -57,10 +55,7 @@ import org.jboss.netty.channel.socket.Cl
 import org.jboss.netty.handler.codec.frame.CorruptedFrameException;
 import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder;
 import org.jboss.netty.handler.codec.frame.TooLongFrameException;
-import org.jboss.netty.handler.timeout.ReadTimeoutException;
 import org.jboss.netty.handler.timeout.ReadTimeoutHandler;
-import org.jboss.netty.util.HashedWheelTimer;
-import org.jboss.netty.util.Timer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -204,8 +199,8 @@ public class PerChannelBookieClient exte
                         closeChannel(future.getChannel());
                         return; // pendingOps should have been completed when other channel
connected
                     } else {
-                        LOG.error("Could not connect to bookie: {}, current state {}",
-                                  future.getChannel(), state);
+                        LOG.error("Could not connect to bookie: {}, current state {} : ",
+                                  new Object[] { future.getChannel(), state, future.getCause()
});
                         rc = BKException.Code.BookieHandleNotAvailableException;
                         closeChannel(future.getChannel());
                         channel = null;
@@ -280,11 +275,10 @@ public class PerChannelBookieClient exte
      * @param ledgerId
      * @param masterKey
      * @param entryId
-     * @param lastConfirmed
-     * @param macCode
-     * @param data
+     * @param toSend
      * @param cb
      * @param ctx
+     * @param options
      */
     void addEntry(final long ledgerId, byte[] masterKey, final long entryId, ChannelBuffer
toSend, WriteCallback cb,
                   Object ctx, final int options) {
@@ -324,6 +318,10 @@ public class PerChannelBookieClient exte
                         }
                         // totalBytesOutstanding.addAndGet(entrySize);
                     } else {
+                        if (!(future.getCause() instanceof ClosedChannelException)) {
+                            LOG.warn("Writing addEntry(lid={}, eid={}) to channel {} failed
: ",
+                                    new Object[] { ledgerId, entryId, c, future.getCause()
});
+                        }
                         errorOutAddKey(completionKey);
                     }
                 }
@@ -371,6 +369,10 @@ public class PerChannelBookieClient exte
                                   + ledgerId + " bookie: " + c.getRemoteAddress());
                     }
                 } else {
+                    if (!(future.getCause() instanceof ClosedChannelException)) {
+                        LOG.warn("Writing readEntryAndFenceLedger(lid={}, eid={}) to channel
{} failed : ",
+                                new Object[] { ledgerId, entryId, c, future.getCause() });
+                    }
                     errorOutReadKey(key);
                 }
             }
@@ -410,6 +412,10 @@ public class PerChannelBookieClient exte
                                                             + ledgerId + " bookie: " + c.getRemoteAddress());
                         }
                     } else {
+                        if (!(future.getCause() instanceof ClosedChannelException)) {
+                            LOG.warn("Writing readEntry(lid={}, eid={}) to channel {} failed
: ",
+                                    new Object[] { ledgerId, entryId, c, future.getCause()
});
+                        }
                         errorOutReadKey(key);
                     }
                 }



Mime
View raw message