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

Replace usage of deprecated LMAX Disruptor APIs

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.9.0
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Description

      We get the following compiler warning due to our usage for deprecated LMAX Disruptor APIs:

      [WARN] E:\vcs\git\apache\logging\logging-log4j2\log4j-core\src\main\java\org\apache\logging\log4j\core\async\AsyncLoggerDisruptor.java:[88,20] [deprecation] Disruptor(EventFactory<T>,int,Executor,ProducerType,WaitStrategy) in Disruptor has been deprecated
      [WARN]   where T is a type-variable:
          T extends Object declared in class Disruptor
      E:\vcs\git\apache\logging\logging-log4j2\log4j-core\src\main\java\org\apache\logging\log4j\core\async\AsyncLoggerDisruptor.java:[88,20] [deprecation] Disruptor(EventFactory<T>,int,Executor,ProducerType,WaitStrategy) in Disruptor has been deprecated
      [WARN]   where T is a type-variable:
          T extends Object declared in class Disruptor
      E:\vcs\git\apache\logging\logging-log4j2\log4j-core\src\main\java\org\apache\logging\log4j\core\async\AsyncLoggerDisruptor.java:[93,17] [deprecation] handleExceptionsWith(ExceptionHandler<? super T>) in Disruptor has been deprecated
      [WARN]   where T is a type-variable:
          T extends Object declared in class Disruptor
      E:\vcs\git\apache\logging\logging-log4j2\log4j-core\src\main\java\org\apache\logging\log4j\core\async\AsyncLoggerConfigDisruptor.java:[165,20] [deprecation] Disruptor(EventFactory<T>,int,Executor,ProducerType,WaitStrategy) in Disruptor has been deprecated
      [WARN]   where T is a type-variable:
          T extends Object declared in class Disruptor
      E:\vcs\git\apache\logging\logging-log4j2\log4j-core\src\main\java\org\apache\logging\log4j\core\async\AsyncLoggerConfigDisruptor.java:[165,20] [deprecation] Disruptor(EventFactory<T>,int,Executor,ProducerType,WaitStrategy) in Disruptor has been deprecated
      [WARN]   where T is a type-variable:
          T extends Object declared in class Disruptor
      E:\vcs\git\apache\logging\logging-log4j2\log4j-core\src\main\java\org\apache\logging\log4j\core\async\AsyncLoggerConfigDisruptor.java:[169,17] [deprecation] handleExceptionsWith(ExceptionHandler<? super T>) in Disruptor has been deprecated
      [WARN]   where T is a type-variable:
          T extends Object declared in class Disruptor
      

        Issue Links

          Activity

          Hide
          remkop@yahoo.com Remko Popma added a comment -

          Fixed in master.

          Sorry for the wait, Gary!

          Show
          remkop@yahoo.com Remko Popma added a comment - Fixed in master. Sorry for the wait, Gary!
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 26f6df84797543a66fc0b7f315f4ea5609053b22 in logging-log4j2's branch refs/heads/master from rpopma
          [ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=26f6df8 ]

          LOG4J2-1261 Async Loggers no longer use deprecated LMAX Disruptor APIs.

          Show
          jira-bot ASF subversion and git services added a comment - Commit 26f6df84797543a66fc0b7f315f4ea5609053b22 in logging-log4j2's branch refs/heads/master from rpopma [ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=26f6df8 ] LOG4J2-1261 Async Loggers no longer use deprecated LMAX Disruptor APIs.
          Hide
          remkop@yahoo.com Remko Popma added a comment -

          I thought about addressing this in 2.6 but I've changed my mind:

          the new API (ThreadFactory instead of Executor, addition of setDefaultExceptionHandler method) was added as recent as Sep 2015 (Disruptor 3.3.3).

          I propose we make these changes when the constructors that take an Executor are actually removed (I believe that will be in Disruptor 3.4).

          I'll attach a patch with the required changes.

          Show
          remkop@yahoo.com Remko Popma added a comment - I thought about addressing this in 2.6 but I've changed my mind: the new API (ThreadFactory instead of Executor, addition of setDefaultExceptionHandler method) was added as recent as Sep 2015 (Disruptor 3.3.3). I propose we make these changes when the constructors that take an Executor are actually removed (I believe that will be in Disruptor 3.4). I'll attach a patch with the required changes.
          Hide
          remkop@yahoo.com Remko Popma added a comment -

          Two thoughts:

          • Not sure we actually can make the change since we no longer have a way to obtain the thread ID of the consumer thread. I will raise this to the maintainer: in my opinion these constructors should not be deprecated.
          • Our docs promise log4j 2 will work with any disruptor version 3.0 and higher. I don't want to break client code just for these compiler warnings.
          Show
          remkop@yahoo.com Remko Popma added a comment - Two thoughts: Not sure we actually can make the change since we no longer have a way to obtain the thread ID of the consumer thread. I will raise this to the maintainer: in my opinion these constructors should not be deprecated. Our docs promise log4j 2 will work with any disruptor version 3.0 and higher. I don't want to break client code just for these compiler warnings.

            People

            • Assignee:
              remkop@yahoo.com Remko Popma
              Reporter:
              garydgregory Gary Gregory
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development