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

Stefan Miklosovic edited comment on CASSANDRA-18320 at 3/10/23 7:28 PM:
------------------------------------------------------------------------

It says that it can not recursively remove a directory because it was not 
empty. This is happening after Cluster (as in dtest jvm api) is being closed.

I wonder how that is related to what we did in CASSANDRA-18294. There are two 
ways of removing stuff, "Java way" (whatever that means) and calling "rm" 
command in *nix by means of CASSANDRA-17427 which adds this 
CassandraRelevantProperty:

{code}
    /** When enabled, recursive directory deletion will be executed using a 
unix command `rm -rf` instead of traversing
     * and removing individual files. This is now used only tests, but 
eventually we will make it true by default.*/
    USE_NIX_RECURSIVE_DELETE("cassandra.use_nix_recursive_delete"),
{code}

When I set this to true before that cleanup logic in simulator kicks in, it 
will just remove it without any error.

https://app.circleci.com/pipelines/github/instaclustr/cassandra/1980/workflows/9cbd06eb-4333-485c-ad38-5986cd4870c6
https://github.com/instaclustr/cassandra/commit/d7c44651d63a75ca017414b172538bd9246e4b98

This property is set only in IDEA test run config but you see that there is the 
intention to set it by default to true in tests without setting any flag.

https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/io/util/PathUtils.java#L391


was (Author: smiklosovic):
It says that it can not recursively remove a directory because it was not 
empty. This is happening after Cluster (as in dtest jvm api) is being closed.

I wonder how that is related to what we did here. There are two ways of 
removing stuff, "Java way" (whatever that means) and calling "rm" command in 
*nix by means of CASSANDRA-17427 which adds this CassandraRelevantProperty:

{code}
    /** When enabled, recursive directory deletion will be executed using a 
unix command `rm -rf` instead of traversing
     * and removing individual files. This is now used only tests, but 
eventually we will make it true by default.*/
    USE_NIX_RECURSIVE_DELETE("cassandra.use_nix_recursive_delete"),
{code}

When I set this to true before that cleanup logic in simulator kicks in, it 
will just remove it without any error.

https://app.circleci.com/pipelines/github/instaclustr/cassandra/1980/workflows/9cbd06eb-4333-485c-ad38-5986cd4870c6
https://github.com/instaclustr/cassandra/commit/d7c44651d63a75ca017414b172538bd9246e4b98

This property is set only in IDEA test run config but you see that there is the 
intention to set it by default to true in tests without setting any flag.

https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/io/util/PathUtils.java#L391

> simulationTest is flaky 
> ------------------------
>
>                 Key: CASSANDRA-18320
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18320
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Ekaterina Dimitrova
>            Priority: Normal
>
> simulationTest is flaky:
> {code:java}
> java.io.UncheckedIOException at 
> org.apache.cassandra.io.util.PathUtils.propagateUnchecked(PathUtils.java:831) 
> at 
> org.apache.cassandra.io.util.PathUtils.propagateUnchecked(PathUtils.java:816) 
> at org.apache.cassandra.io.util.PathUtils.delete(PathUtils.java:257) at 
> org.apache.cassandra.io.util.PathUtils.deleteRecursive(PathUtils.java:381) at 
> java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at 
> java.util.ArrayList.forEach(ArrayList.java:1259) at 
> java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395) at 
> java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) at 
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) 
> at 
> java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) 
> at 
> java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
>  at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at 
> java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) at 
> org.apache.cassandra.io.util.PathUtils.forEach(PathUtils.java:155) at 
> org.apache.cassandra.io.util.PathUtils.deleteRecursive(PathUtils.java:378) at 
> java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at 
> java.util.ArrayList.forEach(ArrayList.java:1259) at 
> java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395) at 
> java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) at 
> java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) 
> at 
> java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) 
> at 
> java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
>  at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at 
> java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) at 
> org.apache.cassandra.io.util.PathUtils.forEach(PathUtils.java:155) at 
> org.apache.cassandra.io.util.PathUtils.deleteRecursive(PathUtils.java:378) at 
> org.apache.cassandra.distributed.impl.AbstractCluster.close(AbstractCluster.java:1047)
>  at 
> org.apache.cassandra.simulator.ClusterSimulation.close(ClusterSimulation.java:816)
>  at 
> org.apache.cassandra.simulator.SimulationRunner$Run.run(SimulationRunner.java:370)
>  at 
> org.apache.cassandra.simulator.SimulationRunner$BasicCommand.run(SimulationRunner.java:345)
>  at 
> org.apache.cassandra.simulator.paxos.PaxosSimulationRunner.main(PaxosSimulationRunner.java:148)
>  at 
> org.apache.cassandra.simulator.test.ShortPaxosSimulationTest.simulationTest(ShortPaxosSimulationTest.java:33)
>  Caused by: java.nio.file.DirectoryNotEmptyException: 
> /cassandra/node1/commitlog at 
> com.google.common.jimfs.FileSystemView.checkEmpty(FileSystemView.java:535) at 
> com.google.common.jimfs.FileSystemView.checkDeletable(FileSystemView.java:517)
>  at com.google.common.jimfs.FileSystemView.delete(FileSystemView.java:479) at 
> com.google.common.jimfs.FileSystemView.deleteFile(FileSystemView.java:465) at 
> com.google.common.jimfs.JimfsFileSystemProvider.delete(JimfsFileSystemProvider.java:261)
>  at java.nio.file.Files.delete(Files.java:1126) at 
> org.apache.cassandra.io.util.PathUtils.delete(PathUtils.java:252){code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to