[ 
https://issues.apache.org/jira/browse/CASSANDRA-6283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13905520#comment-13905520
 ] 

Joshua McKenzie commented on CASSANDRA-6283:
--------------------------------------------

There's pros and cons to either side of the debate - there's some benefits to 
being able to change file handles while in use such as being able to run 
updates, file recovery, etc.  Apparently this is a throwback in OS design to 
MS-DOS 3.3 as far as file-level locking is concerned.

Coming from a C++ background myself I know what you mean w/smart pointers and 
RAII-type resource management, but I believe the problem we're running into 
here is language independent.  We have atomic reference-counting 
implementations in the SSTableReaders to allow multiple concurrent read-only 
access to the data structures which would be a complicated implementation 
regardless of language choice.

I mentioned process explorer not seeing the file handle lock because I found it 
an oddity - my expectation is that anything from Sysinternals and Russinovich 
is bullet-proof, so I'm wondering how the OS got into a state where a file is 
locked yet I can't query the process that has said lock, even though stopping 
the JVM clearly released it.

> Windows 7 data files keept open / can't be deleted after compaction.
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-6283
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6283
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Windows 7 (32) / Java 1.7.0.45
>            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 
> org.apache.cassandra.io.util.RandomAccessReader:
> {code:title=RandomAccessReader.java|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
(v6.1.5#6160)

Reply via email to