cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benyi Wang (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-8281) CQLSSTableWriter close does not work
Date Sat, 27 Dec 2014 20:50:13 GMT


Benyi Wang commented on CASSANDRA-8281:

I believe the root cause of this problem is QueryProcessor, who creates a thread, but never
shutdowns it.

private static final ScheduledExecutorService evictionCheckTimer=Executors.newScheduledThreadPool(1);

I used cassandra-all-2.1.2.jar from maven central. If you run the above example code with
{{Config.setClientMode(true)}} In debug mode in eclipse, you will see the thread created by
QueryProcessor keeps running after the program exits main().

package org.apache.cassandra.hadoop.cql3;

import org.apache.cassandra.config.Config;

public class TWriter2 {

	public static void main(String[] args) {
		String schema = "create table mgindex.test (x int primary key, y int)";
		String insert = "insert into mgindex.test (x,y) values(?,?)";

		CQLSSTableWriter w = CQLSSTableWriter.builder()
		try {
			w.addRow(1, 1);
		} catch (Exception e) {


If you run the similar code in a JUnit test, you won't see this problem. I believe the thread
is terminated by the test runner.

> CQLSSTableWriter close does not work
> ------------------------------------
>                 Key: CASSANDRA-8281
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: API
>         Environment: Cassandra 2.1.1
>            Reporter: Xu Zhongxing
>            Assignee: Benjamin Lerer
>         Attachments: CASSANDRA-8281.txt
> I called CQLSSTableWriter.close(). But the program still cannot exit. But the same code
works fine on Cassandra 2.0.10.
> It seems that CQLSSTableWriter cannot be closed, and blocks the program from exit.

This message was sent by Atlassian JIRA

View raw message