Carter Kozak created LOG4J2-2677:
------------------------------------
Summary: DeleteAction race results in failure to delete rolled
files
Key: LOG4J2-2677
URL: https://issues.apache.org/jira/browse/LOG4J2-2677
Project: Log4j 2
Issue Type: Bug
Affects Versions: 2.12.1
Reporter: Carter Kozak
Uncovered this due to the fix for LOG4J2-2658, these failures were encountered
but not logged previously.
AbstractPathAction.execute uses Files.walkFileTree, which can fail if any file
in the tree is deleted, regardless of whether or not it's related to files
we're deleting. The walkFileTree API doesn't provide any way to continue in
this case.
{code}
2019-08-19 16:47:10,819 Log4j2-TF-12-RollingFileManager-698 WARN Exception
reported by action 'class
org.apache.logging.log4j.core.appender.rolling.RollingFileManager$AsyncAction'
java.nio.file.NoSuchFileException: var/log/event.log
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at
sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
at
sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at
sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
at java.nio.file.FileTreeWalker.next(FileTreeWalker.java:372)
at java.nio.file.Files.walkFileTree(Files.java:2706)
at
org.apache.logging.log4j.core.appender.rolling.action.AbstractPathAction.execute(AbstractPathAction.java:76)
at
org.apache.logging.log4j.core.appender.rolling.action.DeleteAction.getSortedPaths(DeleteAction.java:162)
at
org.apache.logging.log4j.core.appender.rolling.action.DeleteAction.execute(DeleteAction.java:132)
at
org.apache.logging.log4j.core.appender.rolling.action.AbstractPathAction.execute(AbstractPathAction.java:69)
at
org.apache.logging.log4j.core.appender.rolling.action.DeleteAction.execute(DeleteAction.java:82)
at
org.apache.logging.log4j.core.appender.rolling.action.CompositeAction.execute(CompositeAction.java:74)
at
org.apache.logging.log4j.core.appender.rolling.RollingFileManager$AsyncAction.execute(RollingFileManager.java:482)
at
org.apache.logging.log4j.core.appender.rolling.action.AbstractAction.run(AbstractAction.java:66)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
{code}
--
This message was sent by Atlassian Jira
(v8.3.2#803003)