Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-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 601D811000 for ; Wed, 5 Feb 2014 19:18:10 +0000 (UTC) Received: (qmail 24174 invoked by uid 500); 5 Feb 2014 19:18:09 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 24127 invoked by uid 500); 5 Feb 2014 19:18:09 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 24115 invoked by uid 99); 5 Feb 2014 19:18:09 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Feb 2014 19:18:09 +0000 Date: Wed, 5 Feb 2014 19:18:09 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-6656) Exception logging MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-6656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Ellis updated CASSANDRA-6656: -------------------------------------- Reviewer: Mikhail Stepura Priority: Trivial (was: Major) Fix Version/s: 2.1 Assignee: Ding Yuan Can you review, [~mishail]? > Exception logging > ----------------- > > Key: CASSANDRA-6656 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6656 > Project: Cassandra > Issue Type: Improvement > Components: Core, Tools > Reporter: Ding Yuan > Assignee: Ding Yuan > Priority: Trivial > Fix For: 2.1 > > Attachments: trunk-6656.txt > > > Reporting a few cases where informative exceptions can be silently swallowed. Attaching a proposed patch. > ========================= > Case 1 > Line: 95, File: "org/apache/cassandra/utils/Hex.java" > An actual failure in the underlying constructor will be lost. > Propose to log it. > {noformat} > try > { > s = stringConstructor.newInstance(0, c.length, c); > + } > + catch (InvocationTargetException ite) { > + // The underlying constructor failed. Unwrapping the exception. > + logger.info("Underlying constructor throws exception: ", ite.getCause()); > } > catch (Exception e) > { > // Swallowing as we'll just use a copying constructor > } > return s == null ? new String(c) : s; > {noformat} > ========================================== > ========================= > Case 2 > Line: 192, File: "org/apache/cassandra/db/marshal/DynamicCompositeType.java" > The actual cause of comparator error can be lost as it can fail in multiple locations. > {noformat} > AbstractType comparator = null; > int header = getShortLength(bb); > if ((header & 0x8000) == 0) > { > ByteBuffer value = getBytes(bb, header); > try > { > comparator = TypeParser.parse(ByteBufferUtil.string(value)); > } > catch (Exception e) > { > <--- can fail here > // we'll deal with this below since comparator == null > } > } > else > { > comparator = aliases.get((byte)(header & 0xFF)); > <--- can fail here > } > if (comparator == null) > throw new MarshalException("Cannot find comparator for component " + i); > {noformat} > Propose to log the exception. > ========================================== > ========================= > Case 3 > Line: 239, File: "org/apache/cassandra/tools/NodeProbe.java" > Exception ignored in finally. Propose log them with debug or trace. > {noformat} > 232: finally > 233: { > 234: try > 235: { > 236: ssProxy.removeNotificationListener(runner); > 236: ssProxy.removeNotificationListener(runner); > 237: jmxc.removeConnectionNotificationListener(runner); > 238: } > 239: catch (Throwable ignored) {} > 240: } > {noformat} > Similar case is at line 264 in the same file. > ========================================== -- This message was sent by Atlassian JIRA (v6.1.5#6160)