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 64DEB185CA for ; Tue, 15 Dec 2015 21:31:47 +0000 (UTC) Received: (qmail 24616 invoked by uid 500); 15 Dec 2015 21:31:47 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 24570 invoked by uid 500); 15 Dec 2015 21:31:47 -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 24220 invoked by uid 99); 15 Dec 2015 21:31:47 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Dec 2015 21:31:46 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E140F2C1F72 for ; Tue, 15 Dec 2015 21:31:46 +0000 (UTC) Date: Tue, 15 Dec 2015 21:31:46 +0000 (UTC) From: "Alex Liu (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-10837) Cluster/session should be closed in Cassandra Hadoop Input/Output classes 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-10837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15058870#comment-15058870 ] Alex Liu commented on CASSANDRA-10837: -------------------------------------- The changes to CqlRecordWriter seems wrong to me. The Cluster and the Session instances were both properly managed by the try-with-resources statement. In the patch version only the Cluster instance is closed. ================ https://github.com/datastax/java-driver/blob/2.1/driver-core/src/main/java/com/datastax/driver/core/Cluster.java Cluster doesn't implements AutoClosable interface, so it has to be closes manually. Closing cluster will close all session objects associated with it. Making the Cluster an instance variable in NativeRingCache will trigger an error when the write method will be called, as the Cluster has been closed at the end of the constructor. ================= NativeRingCache uses the cluster to get the metadata in the constructor when cluster object is still open. once the initialization of constructor is done, the cluster object is not used by NativeRingCache anymore. In CqlInputFormat could you use try-with-resources for both Cluster and Session instances. I think it is best to do things properly by closing both of them. ================ Similarly closing cluster object auto-close all sessions objects. > Cluster/session should be closed in Cassandra Hadoop Input/Output classes > ------------------------------------------------------------------------- > > Key: CASSANDRA-10837 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10837 > Project: Cassandra > Issue Type: Bug > Components: CQL > Reporter: Alex Liu > Assignee: Alex Liu > Fix For: 3.0.x > > Attachments: 10837-3.0-branch.txt, 10837-v2-3.0-branch.txt > > > See a lot of following warnings during Hadoop job running > {code} > ERROR 11:37:45 LEAK: You are creating too many HashedWheelTimer instances. HashedWheelTimer is a shared resource that must be reused across the JVM,so that only a few instances are created. > {code} > Each cluster/session needs be closed and a shared HashedWheelTimer may reduce the resource leakage. -- This message was sent by Atlassian JIRA (v6.3.4#6332)