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

Lock contention in classloader because of missing org.slf4j.ext.EventData

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.11.0
    • Fix Version/s: 2.13.1
    • Component/s: SLF4J Bridge
    • Labels:
      None

      Description

      Recently I found one of lock contention and performance problem in our application.
      As you can see it happens because we don't have org.slf4j.ext.EventData class in classpath, but slf4j bridge tries to load it on every Logger creation.

      Class java.lang.ClassLoader.loadClass(java.lang.String, boolean)
         Class sun.misc.Launcher$AppClassLoader.loadClass(java.lang.String, boolean)
            Class java.lang.ClassLoader.loadClass(java.lang.String)
               Class org.apache.logging.log4j.util.LoaderUtil.loadClass(java.lang.String)
                  EventDataConverter org.apache.logging.slf4j.Log4jLogger.createConverter()
                     void org.apache.logging.slf4j.Log4jLogger.<init>(org.apache.logging.log4j.spi.ExtendedLogger, java.lang.String)
                        Logger org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(java.lang.String, org.apache.logging.log4j.spi.LoggerContext)
                           Object org.apache.logging.slf4j.Log4jLoggerFactory.newLogger(java.lang.String, org.apache.logging.log4j.spi.LoggerContext)
                              Object org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(java.lang.String)
                                 Logger org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(java.lang.String)
                                    Logger org.slf4j.LoggerFactory.getLogger(java.lang.String)
                                       void com.devexperts.dxcore.api.AccountGroupsCacheImpl.<init>()
      

        Attachments

        1. screenshot-1.png
          142 kB
          Andrey Turbanov
        2. LOG4J2-2415.patch
          1 kB
          Richard Berlin

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                turbanoff Andrey Turbanov
              • Votes:
                1 Vote for this issue
                Watchers:
                6 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 - 50m
                  50m