Issue Type: Bug Bug
Affects Versions: 1.0.4
Assignee: Logback dev list
Components: logback-core
Created: 10/Jul/12 10:54 PM
Description: During a clean tomcat startup (tomcat was stopped before) and initialization of logback we observed that an AsyncAppender may come up without worker thread resulting in a deadlock of the application, because the queue will never be emptied.

We use a lot of AsyncAppenders in our setup, and this Error seldomly happens, so this might be hard to trigger. I suspect a Race condition somewhere?

Here is some logback output with debug turned on:
You see the Worker Thread dies immediately after initialization and nonetheless the initializian continues and the Appender gets added to the ROOT logger.


12:07:07,295 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.classic.AsyncAppender]
12:07:07,295 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [XXX-log-error]
12:07:07,295 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [XXX-sync-log-error] to ch.qos.logback.classic.AsyncAppender[XXX-log-error]
12:07:07,295 |-INFO in ch.qos.logback.classic.AsyncAppender[XXX-log-error] - Attaching appender named [XXX-sync-log-error] to AsyncAppender.
12:07:07,295 |-INFO in ch.qos.logback.classic.AsyncAppender[XXX-log-error] - Setting discardingThreshold to 51
12:07:07,296 |-INFO in ch.qos.logback.classic.AsyncAppender[XXX-log-error] - Worker thread will flush remaining events before exiting.

...
a lot of successfull appender initialization cut out
...

12:07:07,338 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [XXX-log-error] to Logger[ROOT]


Environment: Linux 64bit - Debian Squeeze
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)

tomcat6
Project: logback
Priority: Critical Critical
Reporter: Arnd Hannemann
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira