Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1354

Errors cause AsyncAppender's worker thread to terminate causing halting

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.2.3
    • logback-core
    • None
    • (Not environment specific.)

    Description

      The AsyncAppender worker thread, defined in AsyncAppenderBase, consumes log entries from a bounded blocking queue. Should this worker thread terminate prematurely for any reason and the AsyncAppender be configured as blocking (neverBlock=false) the queue fills and any calls to log block indefinitely.

      The worker thread is currently indirectly tolerant of exceptions thrown by an appender, due to the exception handling in AppenderBase.doAppend, but this exception handling does not cover other Throwable types.

      Ideally, the AsyncAppender worker thread should do everything possible to stay alive while the appender is started.

      Please find attached a patch that can be applied to logback 1.2.3 and/or logback master.

      Branch of master with patch applied: https://github.com/greg-a-atkinson/logback/tree/master_LOGBACK-1354

      Branch of tag 1.2.3 with patch applied: https://github.com/greg-a-atkinson/logback/tree/v_1.2.3_LOGBACK-1354

      Attachments

        Activity

          People

            logback-dev Logback dev list
            Atkinson Greg
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: