cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Schnitzerling (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-6283) Windows 7 data files keept open / can't be deleted after compaction.
Date Wed, 19 Feb 2014 11:43:23 GMT


Andreas Schnitzerling commented on CASSANDRA-6283:

I think, not stopping java in general allows deleting, but stopping the cassandra process
which keeps file handles open. When I first studied the C* code, I found it difficult to see,
how filehandles are spread around in different classes (?). Not easy, to keep the overview
for me, but maybe its because of not enough java experience compared to C++ where I had to
care for handles as well (file, memory). Later in C++, there were autopointers (boost/TR1)
with a finalizer-like approach, where memory was deleted automatically (analog to closing
files), when handle went out of scope or the programmer "forgot" to free/close. I don't know
about the linux' process explorer, where filehandles are expected. But if I probably close
every filehandle after use (even only reading), does it matter, what's in this process explorer,
as long C* is able to delete? BTW if only a read process don't close the file handle, it makes
already sense to forbid to delete, as long the os knows, the file is still used any way. For
me, it's a failure of the os as manager, to allow delete a file, as long there are any filehandles
on it. This strict permission allows me as well, to detect failures in my program logic.

> Windows 7 data files keept open / can't be deleted after compaction.
> --------------------------------------------------------------------
>                 Key: CASSANDRA-6283
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Windows 7 (32) / Java
>            Reporter: Andreas Schnitzerling
>            Assignee: Joshua McKenzie
>              Labels: compaction
>             Fix For: 2.0.6
>         Attachments: leakdetect.patch, screenshot-1.jpg, system.log
> Files cannot be deleted, patch CASSANDRA-5383 (Win7 deleting problem) doesn't help on
Win-7 on Cassandra 2.0.2. Even 2.1 Snapshot is not running. The cause is: Opened file handles
seem to be lost and not closed properly. Win 7 blames, that another process is still using
the file (but its obviously cassandra). Only restart of the server makes the files deleted.
But after heavy using (changes) of tables, there are about 24K files in the data folder (instead
of 35 after every restart) and Cassandra crashes. I experiminted and I found out, that a finalizer
fixes the problem. So after GC the files will be deleted (not optimal, but working fine).
It runs now 2 days continously without problem. Possible fix/test:
> I wrote the following finalizer at the end of class
> {|borderStyle=solid}
> @Override
> protected void finalize() throws Throwable {
> 	deallocate();
> 	super.finalize();
> }
> {code}
> Can somebody test / develop / patch it? Thx.

This message was sent by Atlassian JIRA

View raw message