You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by rajesh <ra...@skava.com> on 2018/04/03 11:38:10 UTC

Jackrabbit oak: Unable to remove tar file ( java.nio.file.FileSystemException )

Hi ,

I am using Jackrabbit oak ( 1.8.2 ). I am running fileStore.fullGC() method
for garbage collection in local repository. But it throws following error
from the log.

2018-04-03 16:51:29.876 DEBUG 10448 --- [rMK flush [oak]]
o.a.j.oak.segment.file.TarRevisions      : Head state did not change,
skipping flush
2018-04-03 16:51:29.876  WARN 10448 --- [er reaper [oak]]
o.a.j.oak.segment.file.FileReaper        : Unable to remove file
oak\data00006a.tar

java.nio.file.FileSystemException: oak\data00006a.tar: The process cannot
access the file because it is being used by another process.

        at sun.nio.fs.WindowsException.translateToIOException(Unknown
Source) ~[na:1.8.0_141]
        at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
~[na:1.8.0_141]
        at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
~[na:1.8.0_141]
        at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
~[na:1.8.0_141]
        at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown
Source) ~[na:1.8.0_141]
        at java.nio.file.Files.deleteIfExists(Unknown Source)
~[na:1.8.0_141]
        at
org.apache.jackrabbit.oak.segment.file.FileReaper.reap(FileReaper.java:73)
~[oak-segment-tar-1.8.2.jar!/:1.8.2]
        at
org.apache.jackrabbit.oak.segment.file.SafeRunnable.run(SafeRunnable.java:68)
~[oak-segment-tar-1.8.2.jar!/:1.8.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) ~[na:1.8.0_141]
        at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
~[na:1.8.0_141]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown
Source) ~[na:1.8.0_141]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
Source) ~[na:1.8.0_141]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
~[na:1.8.0_141]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source) ~[na:1.8.0_141]
        at java.lang.Thread.run(Unknown Source) ~[na:1.8.0_141]


If I set the System.setProperty("sun.arch.data.model", "32"); It works fine.

Should I set this by default ?  Will this cause any problem in the
application because of setting this prop ?

Thanks.





--
Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html

Re: Jackrabbit oak: Unable to remove tar file ( java.nio.file.FileSystemException )

Posted by Michael Dürig <md...@apache.org>.
Hi,

This is a know issue on Windows where memory mapped files cannot be 
deleted until after a JVM GC actually has released them. See 
https://issues.apache.org/jira/browse/OAK-4274 and 
https://bugs.java.com/view_bug.do?bug_id=4724038.

As a workaround you can set the sun.arch.data.model property to 32 as 
described. However the recommended way to switch off memory mapping is 
either via configuration 
(org.apache.jackrabbit.oak.segment.SegmentNodeStoreService#MODE) or in 
code 
(org.apache.jackrabbit.oak.segment.file.FileStoreBuilder#withMemoryMapping)

Alternatively you can ignore this warning. The file reaper will 
re-attempt deleting those files. While this should not have any negative 
impact, I never actually tests this.

Michael

On 03.04.18 13:38, rajesh wrote:
> Hi ,
> 
> I am using Jackrabbit oak ( 1.8.2 ). I am running fileStore.fullGC() method
> for garbage collection in local repository. But it throws following error
> from the log.
> 
> 2018-04-03 16:51:29.876 DEBUG 10448 --- [rMK flush [oak]]
> o.a.j.oak.segment.file.TarRevisions      : Head state did not change,
> skipping flush
> 2018-04-03 16:51:29.876  WARN 10448 --- [er reaper [oak]]
> o.a.j.oak.segment.file.FileReaper        : Unable to remove file
> oak\data00006a.tar
> 
> java.nio.file.FileSystemException: oak\data00006a.tar: The process cannot
> access the file because it is being used by another process.
> 
>          at sun.nio.fs.WindowsException.translateToIOException(Unknown
> Source) ~[na:1.8.0_141]
>          at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
> ~[na:1.8.0_141]
>          at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
> ~[na:1.8.0_141]
>          at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
> ~[na:1.8.0_141]
>          at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(Unknown
> Source) ~[na:1.8.0_141]
>          at java.nio.file.Files.deleteIfExists(Unknown Source)
> ~[na:1.8.0_141]
>          at
> org.apache.jackrabbit.oak.segment.file.FileReaper.reap(FileReaper.java:73)
> ~[oak-segment-tar-1.8.2.jar!/:1.8.2]
>          at
> org.apache.jackrabbit.oak.segment.file.SafeRunnable.run(SafeRunnable.java:68)
> ~[oak-segment-tar-1.8.2.jar!/:1.8.2]
>          at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
> Source) ~[na:1.8.0_141]
>          at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
> ~[na:1.8.0_141]
>          at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown
> Source) ~[na:1.8.0_141]
>          at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
> Source) ~[na:1.8.0_141]
>          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> ~[na:1.8.0_141]
>          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source) ~[na:1.8.0_141]
>          at java.lang.Thread.run(Unknown Source) ~[na:1.8.0_141]
> 
> 
> If I set the System.setProperty("sun.arch.data.model", "32"); It works fine.
> 
> Should I set this by default ?  Will this cause any problem in the
> application because of setting this prop ?
> 
> Thanks.
> 
> 
> 
> 
> 
> --
> Sent from: http://jackrabbit.510166.n4.nabble.com/Jackrabbit-Users-f510167.html
>