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

org.apache.logging.log4j.core.appender.routing.IdlePurgePolicy not working correctly

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.7
    • Component/s: Appenders
    • Labels:
      None

      Description

      There is a problem in the function org.apache.logging.log4j.core.appender.routing.IdlePurgePolicy.scheduleNext().

      I got out of file handles errors despite of setting IdlePurgePolicy. I did some digging I believe following is the cause

      If the createTime is Long.MAX_VALUE, task is never scheduled. However function org.apache.logging.log4j.core.appender.routing.IdlePurgePolicy.update(String, LogEvent) checks if the future is not null before deciding to schedule.

      After appendersUsage becomes empty first time, appenders keep piling up.

      I believe fix will be to set future to null in the function scheduleNext in the else part of the condition where it checks for createTime

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                garydgregory Gary Gregory
                Reporter:
                nhrdls Niranjan Rao
              • Votes:
                3 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: