[jira] [Commented] (CALCITE-3739) Remove failed snapshot track file in Windows OS for Cassandra adapter

2020-02-12 Thread Feng Zhu (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17035894#comment-17035894
 ] 

Feng Zhu commented on CALCITE-3739:
---

Fixed in CALCITE-2442.

> Remove failed snapshot track file in Windows OS for Cassandra adapter
> -
>
> Key: CALCITE-3739
> URL: https://issues.apache.org/jira/browse/CALCITE-3739
> Project: Calcite
>  Issue Type: Bug
>  Components: cassandra-adapter
>Reporter: Feng Zhu
>Priority: Major
> Fix For: 1.22.0
>
> Attachments: screen.png
>
>
> In Windows OS, CassandraUnit leaves an extra "cassandra/.toDelete" snapshot 
> track file.
>  After migrating to Gradle, it is flagged as "unapproved license" and fails 
> on "rat" task.
>  It is annoying to manually delete this file every time.
> !screen.png!
> The issue is also mentioned in CALCITE-2442. But I found the snapshot file 
> still exists with the fix.
> {code:java}
>   @AfterClass
>   public static void tearDown() {
> if (RULE instanceof CassandraCQLUnit) {
>   CassandraCQLUnit rule = (CassandraCQLUnit) RULE;
>   rule.getSession().close();
>   rule.getCluster().close();
>   // see https://issues.apache.org/jira/browse/CALCITE-2442
>   // see https://issues.apache.org/jira/browse/CASSANDRA-13085
>   // Is it done by cluster.close() already ?
>   if (FBUtilities.isWindows) {
> WindowsFailedSnapshotTracker.deleteOldSnapshots();
>   }
> }
>   }
> {code}
> I make some profling work. It seems that the snapshot track file is locked by 
> other threads.
>  "The process cannot access the file because it is being used by another 
> process."
>  Any ideas?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3739) Remove failed snapshot track file in Windows OS for Cassandra adapter

2020-02-12 Thread Andrei Sereda (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17035701#comment-17035701
 ] 

Andrei Sereda commented on CALCITE-3739:


I have updated cassandra tests to JUnit5 which allows to have a callback after 
all tests. 
[~donnyzone] sorry to bother you, but can you pls test again ? 

> Remove failed snapshot track file in Windows OS for Cassandra adapter
> -
>
> Key: CALCITE-3739
> URL: https://issues.apache.org/jira/browse/CALCITE-3739
> Project: Calcite
>  Issue Type: Bug
>  Components: cassandra-adapter
>Reporter: Feng Zhu
>Priority: Major
> Attachments: screen.png
>
>
> In Windows OS, CassandraUnit leaves an extra "cassandra/.toDelete" snapshot 
> track file.
>  After migrating to Gradle, it is flagged as "unapproved license" and fails 
> on "rat" task.
>  It is annoying to manually delete this file every time.
> !screen.png!
> The issue is also mentioned in CALCITE-2442. But I found the snapshot file 
> still exists with the fix.
> {code:java}
>   @AfterClass
>   public static void tearDown() {
> if (RULE instanceof CassandraCQLUnit) {
>   CassandraCQLUnit rule = (CassandraCQLUnit) RULE;
>   rule.getSession().close();
>   rule.getCluster().close();
>   // see https://issues.apache.org/jira/browse/CALCITE-2442
>   // see https://issues.apache.org/jira/browse/CASSANDRA-13085
>   // Is it done by cluster.close() already ?
>   if (FBUtilities.isWindows) {
> WindowsFailedSnapshotTracker.deleteOldSnapshots();
>   }
> }
>   }
> {code}
> I make some profling work. It seems that the snapshot track file is locked by 
> other threads.
>  "The process cannot access the file because it is being used by another 
> process."
>  Any ideas?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3739) Remove failed snapshot track file in Windows OS for Cassandra adapter

2020-01-15 Thread Feng Zhu (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17016485#comment-17016485
 ] 

Feng Zhu commented on CALCITE-3739:
---

I put Calcite project in my disk F. The full path is: 
*F:\Calcite\cassandra\.toDelete*

 

> Remove failed snapshot track file in Windows OS for Cassandra adapter
> -
>
> Key: CALCITE-3739
> URL: https://issues.apache.org/jira/browse/CALCITE-3739
> Project: Calcite
>  Issue Type: Bug
>  Components: cassandra-adapter
>Reporter: Feng Zhu
>Priority: Major
> Attachments: screen.png
>
>
> In Windows OS, CassandraUnit leaves an extra "cassandra/.toDelete" snapshot 
> track file.
>  After migrating to Gradle, it is flagged as "unapproved license" and fails 
> on "rat" task.
>  It is annoying to manually delete this file every time.
> !screen.png!
> The issue is also mentioned in CALCITE-2442. But I found the snapshot file 
> still exists with the fix.
> {code:java}
>   @AfterClass
>   public static void tearDown() {
> if (RULE instanceof CassandraCQLUnit) {
>   CassandraCQLUnit rule = (CassandraCQLUnit) RULE;
>   rule.getSession().close();
>   rule.getCluster().close();
>   // see https://issues.apache.org/jira/browse/CALCITE-2442
>   // see https://issues.apache.org/jira/browse/CASSANDRA-13085
>   // Is it done by cluster.close() already ?
>   if (FBUtilities.isWindows) {
> WindowsFailedSnapshotTracker.deleteOldSnapshots();
>   }
> }
>   }
> {code}
> I make some profling work. It seems that the snapshot track file is locked by 
> other threads.
>  "The process cannot access the file because it is being used by another 
> process."
>  Any ideas?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3739) Remove failed snapshot track file in Windows OS for Cassandra adapter

2020-01-15 Thread Andrei Sereda (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17016480#comment-17016480
 ] 

Andrei Sereda commented on CALCITE-3739:


What is the full path to {{f}} ?

{code:java}
Paths.get(f).toAbsolutePath()
{code}

> Remove failed snapshot track file in Windows OS for Cassandra adapter
> -
>
> Key: CALCITE-3739
> URL: https://issues.apache.org/jira/browse/CALCITE-3739
> Project: Calcite
>  Issue Type: Bug
>  Components: cassandra-adapter
>Reporter: Feng Zhu
>Priority: Major
> Attachments: screen.png
>
>
> In Windows OS, CassandraUnit leaves an extra "cassandra/.toDelete" snapshot 
> track file.
>  After migrating to Gradle, it is flagged as "unapproved license" and fails 
> on "rat" task.
>  It is annoying to manually delete this file every time.
> !screen.png!
> The issue is also mentioned in CALCITE-2442. But I found the snapshot file 
> still exists with the fix.
> {code:java}
>   @AfterClass
>   public static void tearDown() {
> if (RULE instanceof CassandraCQLUnit) {
>   CassandraCQLUnit rule = (CassandraCQLUnit) RULE;
>   rule.getSession().close();
>   rule.getCluster().close();
>   // see https://issues.apache.org/jira/browse/CALCITE-2442
>   // see https://issues.apache.org/jira/browse/CASSANDRA-13085
>   // Is it done by cluster.close() already ?
>   if (FBUtilities.isWindows) {
> WindowsFailedSnapshotTracker.deleteOldSnapshots();
>   }
> }
>   }
> {code}
> I make some profling work. It seems that the snapshot track file is locked by 
> other threads.
>  "The process cannot access the file because it is being used by another 
> process."
>  Any ideas?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3739) Remove failed snapshot track file in Windows OS for Cassandra adapter

2020-01-15 Thread Feng Zhu (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17016475#comment-17016475
 ] 

Feng Zhu commented on CALCITE-3739:
---

Hi [~sereda],

When I found that _*WindowsFailedSnapshotTracker.deleteOldSnapshots*_ fails to 
delete file without any exception, I manually copy its code as below.
{code:java}
  public static void tearDown() {
if (RULE instanceof CassandraCQLUnit) {
  CassandraCQLUnit rule = (CassandraCQLUnit) RULE;
  rule.getSession().close();
  rule.getCluster().close();
  if (FBUtilities.isWindows) {
WindowsFailedSnapshotTracker.deleteOldSnapshots();

String f = System.getenv("CASSANDRA_HOME") == null
? ".toDelete"
: System.getenv("CASSANDRA_HOME") + File.separator + ".toDelete";
try {
  Files.delete(Paths.get(f));
} catch (IOException e) {
  e.printStackTrace();
}
  }
}
  }
{code}
The stackstrace is:
{code:java}
org.apache.calcite.test.CassandraAdapterTest STANDARD_ERROR
java.nio.file.FileSystemException: .toDelete: The process cannot access the 
file because it is being used by another process.
at 
sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
at 
sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at 
sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at 
sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
at 
sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
at java.nio.file.Files.delete(Files.java:1126)
at 
org.apache.calcite.test.CassandraAdapterTest.tearDown(CassandraAdapterTest.java:154)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at 
org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:43)
at 
java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at 
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at 
java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at 
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at 
java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at 
java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at 
java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at 
org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:82)
at 
org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:73)
at 
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
at 
org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
at 
org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
at 
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
at 
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
at 
org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
at 

[jira] [Commented] (CALCITE-3739) Remove failed snapshot track file in Windows OS for Cassandra adapter

2020-01-15 Thread Andrei Sereda (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17016440#comment-17016440
 ] 

Andrei Sereda commented on CALCITE-3739:


[~donnyzone] do you have a stack trace with locked threads ?  

> Remove failed snapshot track file in Windows OS for Cassandra adapter
> -
>
> Key: CALCITE-3739
> URL: https://issues.apache.org/jira/browse/CALCITE-3739
> Project: Calcite
>  Issue Type: Bug
>  Components: cassandra-adapter
>Reporter: Feng Zhu
>Priority: Major
> Attachments: screen.png
>
>
> In Windows OS, CassandraUnit leaves an extra "cassandra/.toDelete" snapshot 
> track file.
>  After migrating to Gradle, it is flagged as "unapproved license" and fails 
> on "rat" task.
>  It is annoying to manually delete this file every time.
> !screen.png!
> The issue is also mentioned in CALCITE-2442. But I found the snapshot file 
> still exists with the fix.
> {code:java}
>   @AfterClass
>   public static void tearDown() {
> if (RULE instanceof CassandraCQLUnit) {
>   CassandraCQLUnit rule = (CassandraCQLUnit) RULE;
>   rule.getSession().close();
>   rule.getCluster().close();
>   // see https://issues.apache.org/jira/browse/CALCITE-2442
>   // see https://issues.apache.org/jira/browse/CASSANDRA-13085
>   // Is it done by cluster.close() already ?
>   if (FBUtilities.isWindows) {
> WindowsFailedSnapshotTracker.deleteOldSnapshots();
>   }
> }
>   }
> {code}
> I make some profling work. It seems that the snapshot track file is locked by 
> other threads.
>  "The process cannot access the file because it is being used by another 
> process."
>  Any ideas?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (CALCITE-3739) Remove failed snapshot track file in Windows OS for Cassandra adapter

2020-01-15 Thread Andrei Sereda (Jira)


[ 
https://issues.apache.org/jira/browse/CALCITE-3739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17016425#comment-17016425
 ] 

Andrei Sereda commented on CALCITE-3739:


[~donnyzone] this PR was not yet merged.

 

Let me take a look right now

> Remove failed snapshot track file in Windows OS for Cassandra adapter
> -
>
> Key: CALCITE-3739
> URL: https://issues.apache.org/jira/browse/CALCITE-3739
> Project: Calcite
>  Issue Type: Bug
>  Components: cassandra-adapter
>Reporter: Feng Zhu
>Priority: Major
> Attachments: screen.png
>
>
> In Windows OS, CassandraUnit leaves an extra "cassandra/.toDelete" snapshot 
> track file.
>  After migrating to Gradle, it is flagged as "unapproved license" and fails 
> on "rat" task.
>  It is annoying to manually delete this file every time.
> !screen.png!
> The issue is also mentioned in CALCITE-2442. But I found the snapshot file 
> still exists with the fix.
> {code:java}
>   @AfterClass
>   public static void tearDown() {
> if (RULE instanceof CassandraCQLUnit) {
>   CassandraCQLUnit rule = (CassandraCQLUnit) RULE;
>   rule.getSession().close();
>   rule.getCluster().close();
>   // see https://issues.apache.org/jira/browse/CALCITE-2442
>   // see https://issues.apache.org/jira/browse/CASSANDRA-13085
>   // Is it done by cluster.close() already ?
>   if (FBUtilities.isWindows) {
> WindowsFailedSnapshotTracker.deleteOldSnapshots();
>   }
> }
>   }
> {code}
> I make some profling work. It seems that the snapshot track file is locked by 
> other threads.
>  "The process cannot access the file because it is being used by another 
> process."
>  Any ideas?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)