I'm experiencing a problem running a suite of integration tests on Windows 7, using Cassandra 1.0.9 and Java 1.6.0_31. A new cassandra instance is spun up for each test class and shut down afterwards, using the Maven Failsafe plugin. The problem is that the Commitlog file seems to be kept open, and so subsequent test classes fail to delete it. Here is the stack trace:
java.io.IOException: Failed to delete D:\amee.realtime.api\server\engine\tmp\var\lib\cassandra\commitlog\CommitLog-1335190398587.log
I've tried to delete the file when shutting down Cassandra and before firing up a new one. I've tried setting the failsafe plugin's forkMode to both "once" and "always", so that it fires up a new JVM for each test or a single JVM for all tests; the results are similar. Debugging through the code takes me right down to the native method call in the windows filesystem class in the JVM, and an access denied error is returned; I'm also unable to delete it manually through Windows Explorer or a terminal window at that point (with the JVM suspended), and running Process Explorer indicates that a Java process has a handle open to that file.
Does anyone have any ideas on how to avoid this issue? I don't have any way of knowing what it is that's holding onto this file other than a Java process.