cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Liu (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-10837) Cluster/session should be closed in Cassandra Hadoop Input/Output classes
Date Tue, 15 Dec 2015 21:31:46 GMT


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.
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:
>             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

This message was sent by Atlassian JIRA

View raw message