[jira] [Comment Edited] (CASSANDRA-8390) The process cannot access the file because it is being used by another process

2015-04-08 Thread Maxim Podkolzine (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14485150#comment-14485150
 ] 

Maxim Podkolzine edited comment on CASSANDRA-8390 at 4/8/15 12:30 PM:
--

We have tested Cassandra 2.1.4 and still see The process cannot access the 
file because it is being used by another process every 2-3 hours.
Though this time Cassandra does not fail, but just stops gently.
Does it mean that patches for CASSANDRA-8535, CASSANDRA-8812 and others were 
not included in 2.1.4?

UPD: I see from commits that these patches got into 2.1 branch, but not into 
2.1.4


was (Author: maximp):
We have tested Cassandra 2.1.4 and still see The process cannot access the 
file because it is being used by another process every 2-3 hours.
Though this time Cassandra does not fail, but just stops gently.
Does it mean that patches for CASSANDRA-8535, CASSANDRA-8812 and others were 
not included in 2.1.4?

 The process cannot access the file because it is being used by another process
 --

 Key: CASSANDRA-8390
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8390
 Project: Cassandra
  Issue Type: Bug
Reporter: Ilya Komolkin
Assignee: Joshua McKenzie
 Fix For: 3.0

 Attachments: CassandraDiedWithDiskAccessModeStandardLogs.7z, FSD.PNG, 
 NoHostAvailableLogs.zip, recreate-CASSANDRA-8390.tgz


 {code}21:46:27.810 [NonPeriodicTasks:1] ERROR o.a.c.service.CassandraDaemon - 
 Exception in thread Thread[NonPeriodicTasks:1,5,main]
 org.apache.cassandra.io.FSWriteError: java.nio.file.FileSystemException: 
 E:\Upsource_12391\data\cassandra\data\kernel\filechangehistory_t-a277b560764611e48c8e4915424c75fe\kernel-filechangehistory_t-ka-33-Index.db:
  The process cannot access the file because it is being used by another 
 process.
  
 at 
 org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:135) 
 ~[cassandra-all-2.1.1.jar:2.1.1]
 at 
 org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:121) 
 ~[cassandra-all-2.1.1.jar:2.1.1]
 at 
 org.apache.cassandra.io.sstable.SSTable.delete(SSTable.java:113) 
 ~[cassandra-all-2.1.1.jar:2.1.1]
 at 
 org.apache.cassandra.io.sstable.SSTableDeletingTask.run(SSTableDeletingTask.java:94)
  ~[cassandra-all-2.1.1.jar:2.1.1]
 at 
 org.apache.cassandra.io.sstable.SSTableReader$6.run(SSTableReader.java:664) 
 ~[cassandra-all-2.1.1.jar:2.1.1]
 at 
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
 ~[na:1.7.0_71]
 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
 ~[na:1.7.0_71]
 at 
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
  ~[na:1.7.0_71]
 at 
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
  ~[na:1.7.0_71]
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  ~[na:1.7.0_71]
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  [na:1.7.0_71]
 at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
 Caused by: java.nio.file.FileSystemException: 
 E:\Upsource_12391\data\cassandra\data\kernel\filechangehistory_t-a277b560764611e48c8e4915424c75fe\kernel-filechangehistory_t-ka-33-Index.db:
  The process cannot access the file because it is being used by another 
 process.
  
 at 
 sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) 
 ~[na:1.7.0_71]
 at 
 sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) 
 ~[na:1.7.0_71]
 at 
 sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) 
 ~[na:1.7.0_71]
 at 
 sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
  ~[na:1.7.0_71]
 at 
 sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
  ~[na:1.7.0_71]
 at java.nio.file.Files.delete(Files.java:1079) ~[na:1.7.0_71]
 at 
 org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:131) 
 ~[cassandra-all-2.1.1.jar:2.1.1]
 ... 11 common frames omitted{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (CASSANDRA-8390) The process cannot access the file because it is being used by another process

2015-02-02 Thread Wei Yuan Cho (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14301135#comment-14301135
 ] 

Wei Yuan Cho edited comment on CASSANDRA-8390 at 2/2/15 10:48 AM:
--

Hi there,

I have a similar error as this thread and I'm running Windows Server 2008.
I have set to DiskAccessMode to standard and I'm still getting the following 
error

INFO  [main] 2015-01-23 16:41:01,578 DatabaseDescriptor.java:211 - 
DiskAccessMode is standard, indexAccessMode is standard


{quote}
ERROR [NonPeriodicTasks:1] 2015-01-30 22:02:02,284 SSTableDeletingTask.java:89 
- Unable to delete 
\var\lib\cassandra\data\CM\Alerts\CM-Alerts-ka-137342-Data.db (it will be 
removed on server restart; we'll also retry after GC)
ERROR [NonPeriodicTasks:1] 2015-01-30 22:02:02,284 SSTableDeletingTask.java:89 
- Unable to delete 
\var\lib\cassandra\data\CM\Alerts\CM-Alerts-ka-137341-Data.db (it will be 
removed on server restart; we'll also retry after GC)
INFO  [CompactionExecutor:3644] 2015-01-30 22:02:02,284 CompactionTask.java:252 
- Compacted 4 sstables to 
[\var\lib\cassandra\data\CM\Alerts\CM-Alerts-ka-137344,].  4,830,501 bytes to 
2,453,934 (~50% of original) in 1,433ms = 1.633115MB/s.  13 total partitions 
merged to 4.  Partition merge counts were {1:1, 4:3, }
INFO  [CompactionExecutor:3645] 2015-01-30 22:02:02,565 CompactionTask.java:252 
- Compacted 4 sstables to 
[\var\lib\cassandra\data\system\compactions_in_progress-55080ab05d9c388690a4acb25fe1f77b\system-compactions_in_progress-ka-5659,].
  424 bytes to 42 (~9% of original) in 285ms = 0.000141MB/s.  4 total 
partitions merged to 1.  Partition merge counts were {2:2, }
ERROR [NonPeriodicTasks:1] 2015-01-30 22:02:02,659 CassandraDaemon.java:153 - 
Exception in thread Thread[NonPeriodicTasks:1,5,main]
org.apache.cassandra.io.FSWriteError: java.nio.file.FileSystemException: 
\var\lib\cassandra\data\CM\Alerts\CM-Alerts-ka-137339-Index.db: The process 
cannot access the file because it is being used by another process.

at 
org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:135) 
~[apache-cassandra-2.1.1.jar:2.1.1]
at 
org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:121) 
~[apache-cassandra-2.1.1.jar:2.1.1]
at org.apache.cassandra.io.sstable.SSTable.delete(SSTable.java:113) 
~[apache-cassandra-2.1.1.jar:2.1.1]
at 
org.apache.cassandra.io.sstable.SSTableDeletingTask.run(SSTableDeletingTask.java:94)
 ~[apache-cassandra-2.1.1.jar:2.1.1]
at 
org.apache.cassandra.io.sstable.SSTableReader$6.run(SSTableReader.java:664) 
~[apache-cassandra-2.1.1.jar:2.1.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
~[na:1.7.0_71]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_71]
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown
 Source) ~[na:1.7.0_71]
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
 Source) ~[na:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
[na:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
[na:1.7.0_71]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_71]
Caused by: java.nio.file.FileSystemException: 
\var\lib\cassandra\data\CM\Alerts\CM-Alerts-ka-137339-Index.db: The process 
cannot access the file because it is being used by another process.

at sun.nio.fs.WindowsException.translateToIOException(Unknown Source) 
~[na:1.7.0_71]
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) 
~[na:1.7.0_71]
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) 
~[na:1.7.0_71]
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source) 
~[na:1.7.0_71]
at sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source) 
~[na:1.7.0_71]
at java.nio.file.Files.delete(Unknown Source) ~[na:1.7.0_71]
at 
org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:131) 
~[apache-cassandra-2.1.1.jar:2.1.1]
... 11 common frames omitted
ERROR [NonPeriodicTasks:1] 2015-01-30 22:02:02,925 StorageService.java:377 - 
Stopping gossiper
WARN  [NonPeriodicTasks:1] 2015-01-30 22:02:02,925 StorageService.java:291 - 
Stopping gossip by operator request
INFO  [NonPeriodicTasks:1] 2015-01-30 22:02:02,925 Gossiper.java:1317 - 
Announcing shutdown
ERROR [NonPeriodicTasks:1] 2015-01-30 22:02:04,925 StorageService.java:382 - 
Stopping RPC server
INFO  [NonPeriodicTasks:1] 2015-01-30 22:02:04,925 ThriftServer.java:142 - Stop 
listening to thrift clients
ERROR [NonPeriodicTasks:1] 2015-01-30 22:02:04,956 StorageService.java:387 - 
Stopping native transport
INFO  [NonPeriodicTasks:1] 2015-01-30 22:02:05,519 Server.java:213 - Stop 
listening for CQL 

[jira] [Comment Edited] (CASSANDRA-8390) The process cannot access the file because it is being used by another process

2014-12-23 Thread Alexander Radzin (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14257183#comment-14257183
 ] 

Alexander Radzin edited comment on CASSANDRA-8390 at 12/23/14 4:41 PM:
---

Attached Log files (NoHostAvailable.zip) from run that reproduces 
NoHostAvailable problem. The {{cqlSync}} successfully finished 11 iterations 
and failed while doing the iterration #12. 

This is the client side exception:

{noformat}
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried 
for query failed (tried: localhost/127.0.0.1:9042 
(com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] 
Connection has been closed))
at 
com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:65)
at 
com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:259)
at 
com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:175)
at 
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52)
at 
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:36)
at 
com.clarisite.clingine.dataaccesslayer.cassandra.CQLTest.cqlSync(CQLTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at 
com.intellij.junit4.JUnit4TestRunnerUtil$IgnoreIgnoredTestJUnit4ClassRunner.runChild(JUnit4TestRunnerUtil.java:269)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All 
host(s) tried for query failed (tried: localhost/127.0.0.1:9042 
(com.datastax.driver.core.TransportException: [localhost/127.0.0.1:9042] 
Connection has been closed))
at 
com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:102)
at 
com.datastax.driver.core.RequestHandler$1.run(RequestHandler.java:176)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
{noformat}

Here is the server side exception:

{noformat}
INFO  16:28:12 Compacted 4 sstables to 
[c:\progs\apache-cassandra-2.1.2\data\data\system\schema_columnfamilies-45f5b36024bc3f83a3631034ea4fa697\system-schema_columnfamilies-ka-881,].
  297,142 bytes to 295,369 (~99% of original) in 375ms = 0.751162MB/s.  16 
total partitions merged to 13.  Partition merge counts were {1:12, 4:1, }
ERROR 16:28:12 Unable to delete 
c:\progs\apache-cassandra-2.1.2\data\data\system\schema_columnfamilies-45f5b36024bc3f83a3631034ea4fa697\system-schema_columnfamilies-ka-879-Data.db
 (it will be removed on server restart; we'll also retry after GC)
ERROR 16:28:12 Exception in thread 

[jira] [Comment Edited] (CASSANDRA-8390) The process cannot access the file because it is being used by another process

2014-12-10 Thread Alexander Radzin (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14240844#comment-14240844
 ] 

Alexander Radzin edited comment on CASSANDRA-8390 at 12/10/14 9:26 AM:
---

I have the same issue with Windows 8. Here is the DiskAccessMode line that I 
found in system.log of cassandra:

{noformat}
INFO  [main] 2014-12-09 16:07:25,985 DatabaseDescriptor.java:203 - 
DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap
{noformat}

I have several lines like this. 

Important: when this happens client gets {{NoHostAvailableException}} and stops 
working that requires restart of cassandra.

{noformat}
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried 
for query failed (no host was tried)
at 
com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:65)
at 
com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:259)
at 
com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:175)
at 
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52)
at 
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:36)
at 
com.clarisite.clingine.dataaccesslayer.cassandra.CQLTest1.cqlSync(CQLTest1.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All 
host(s) tried for query failed (no host was tried)
at 
com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:102)
at 
com.datastax.driver.core.SessionManager.execute(SessionManager.java:461)
at 
com.datastax.driver.core.SessionManager.executeQuery(SessionManager.java:497)
at 
com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:87)
... 34 more
{noformat}


Here are the conditions that make this problem to be reproduced. 
Our application creates new keyspace every day. The keyspace contains about 60 
tables. The issue happened on production relatively seldom, however it happens 
in testing environment all the time because each test case creates keyspace 
again. I guess that the problem is not specifically in creating keyspace and 
tables because sometimes the problem happens when trying to run {{truncate}}. 

Cassandra DB is running using default settings. The client code looks like the 
following:

{noformat}
Cluster cluster = 
Cluster.builder().addContactPoint(localhost).build();
Session session = 

[jira] [Comment Edited] (CASSANDRA-8390) The process cannot access the file because it is being used by another process

2014-12-10 Thread Alexander Radzin (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14240844#comment-14240844
 ] 

Alexander Radzin edited comment on CASSANDRA-8390 at 12/10/14 10:29 AM:


I have the same issue with Windows 8. Here is the DiskAccessMode line that I 
found in system.log of cassandra:

{noformat}
INFO  [main] 2014-12-09 16:07:25,985 DatabaseDescriptor.java:203 - 
DiskAccessMode 'auto' determined to be mmap, indexAccessMode is mmap
{noformat}

I have several lines like this. 

Important: when this happens client gets {{NoHostAvailableException}} and stops 
working that requires restart of cassandra.

{noformat}
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried 
for query failed (no host was tried)
at 
com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:65)
at 
com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:259)
at 
com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:175)
at 
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52)
at 
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:36)
at 
com.clarisite.clingine.dataaccesslayer.cassandra.CQLTest1.cqlSync(CQLTest1.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All 
host(s) tried for query failed (no host was tried)
at 
com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:102)
at 
com.datastax.driver.core.SessionManager.execute(SessionManager.java:461)
at 
com.datastax.driver.core.SessionManager.executeQuery(SessionManager.java:497)
at 
com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:87)
... 34 more
{noformat}


Here are the conditions that make this problem to be reproduced. 
Our application creates new keyspace every day. The keyspace contains about 60 
tables. The issue happened on production relatively seldom, however it happens 
in testing environment all the time because each test case creates keyspace 
again. I guess that the problem is not specifically in creating keyspace and 
tables because sometimes the problem happens when trying to run {{truncate}}. 

Cassandra DB is running using default settings. The client code looks like the 
following:

{noformat}
Cluster cluster = 
Cluster.builder().addContactPoint(localhost).build();
Session session = 

[jira] [Comment Edited] (CASSANDRA-8390) The process cannot access the file because it is being used by another process

2014-12-10 Thread Alexander Radzin (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-8390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14241255#comment-14241255
 ] 

Alexander Radzin edited comment on CASSANDRA-8390 at 12/10/14 4:06 PM:
---

Joshua McKenzie, I tried this with the same result. I validated that the 
parameter was indeed used by cassandra by changing value to something illegal. 
This threw exception. 


was (Author: alexander_radzin):
Joshua McKenzie, I tried this with the same result. I validated that the value 
was indeed used by cassandra by changing value to something illegal. This threw 
exception. 

 The process cannot access the file because it is being used by another process
 --

 Key: CASSANDRA-8390
 URL: https://issues.apache.org/jira/browse/CASSANDRA-8390
 Project: Cassandra
  Issue Type: Bug
Reporter: Ilya Komolkin
Assignee: Joshua McKenzie
 Fix For: 2.1.3


 21:46:27.810 [NonPeriodicTasks:1] ERROR o.a.c.service.CassandraDaemon - 
 Exception in thread Thread[NonPeriodicTasks:1,5,main]
 org.apache.cassandra.io.FSWriteError: java.nio.file.FileSystemException: 
 E:\Upsource_12391\data\cassandra\data\kernel\filechangehistory_t-a277b560764611e48c8e4915424c75fe\kernel-filechangehistory_t-ka-33-Index.db:
  The process cannot access the file because it is being used by another 
 process.
  
 at 
 org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:135) 
 ~[cassandra-all-2.1.1.jar:2.1.1]
 at 
 org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:121) 
 ~[cassandra-all-2.1.1.jar:2.1.1]
 at 
 org.apache.cassandra.io.sstable.SSTable.delete(SSTable.java:113) 
 ~[cassandra-all-2.1.1.jar:2.1.1]
 at 
 org.apache.cassandra.io.sstable.SSTableDeletingTask.run(SSTableDeletingTask.java:94)
  ~[cassandra-all-2.1.1.jar:2.1.1]
 at 
 org.apache.cassandra.io.sstable.SSTableReader$6.run(SSTableReader.java:664) 
 ~[cassandra-all-2.1.1.jar:2.1.1]
 at 
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
 ~[na:1.7.0_71]
 at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
 ~[na:1.7.0_71]
 at 
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
  ~[na:1.7.0_71]
 at 
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
  ~[na:1.7.0_71]
 at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  ~[na:1.7.0_71]
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  [na:1.7.0_71]
 at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
 Caused by: java.nio.file.FileSystemException: 
 E:\Upsource_12391\data\cassandra\data\kernel\filechangehistory_t-a277b560764611e48c8e4915424c75fe\kernel-filechangehistory_t-ka-33-Index.db:
  The process cannot access the file because it is being used by another 
 process.
  
 at 
 sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) 
 ~[na:1.7.0_71]
 at 
 sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) 
 ~[na:1.7.0_71]
 at 
 sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) 
 ~[na:1.7.0_71]
 at 
 sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
  ~[na:1.7.0_71]
 at 
 sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
  ~[na:1.7.0_71]
 at java.nio.file.Files.delete(Files.java:1079) ~[na:1.7.0_71]
 at 
 org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:131) 
 ~[cassandra-all-2.1.1.jar:2.1.1]
 ... 11 common frames omitted



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)