Return-Path: X-Original-To: apmail-zookeeper-commits-archive@www.apache.org Delivered-To: apmail-zookeeper-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC77F10177 for ; Mon, 10 Mar 2014 02:07:29 +0000 (UTC) Received: (qmail 86685 invoked by uid 500); 10 Mar 2014 02:07:29 -0000 Delivered-To: apmail-zookeeper-commits-archive@zookeeper.apache.org Received: (qmail 86616 invoked by uid 500); 10 Mar 2014 02:07:29 -0000 Mailing-List: contact commits-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ Delivered-To: mailing list commits@zookeeper.apache.org Received: (qmail 86608 invoked by uid 99); 10 Mar 2014 02:07:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2014 02:07:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2014 02:07:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7673C238897A; Mon, 10 Mar 2014 02:07:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@zookeeper.apache.org From: sijie@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140310020704.7673C238897A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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); } }