Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2677

DeleteAction race results in failure to delete rolled files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.12.1
    • 2.13.1
    • None
    • None

    Description

      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.

      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)
      

      Attachments

        Issue Links

          Activity

            People

              ckozak Carter Kozak
              ckozak Carter Kozak
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m