[logback-dev] [JIRA] Closed: (LBCLASSIC-148) Deadlock with DBAppender

Ceki Gulcu (JIRA) noreply-jira at qos.ch
Wed Mar 24 20:16:16 CET 2010


     [ http://jira.qos.ch/browse/LBCLASSIC-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ceki Gulcu closed LBCLASSIC-148.
--------------------------------

    Resolution: Won't Fix


I believe that there isn't much we can do from the logback side. The
deadlock can be circumvented by:

1) silence logs generated by "com.mchange.v2" loggers and its children
by adding the following to the config file

 <logger name="com.mchange.v2" level="OFF"/>

or 2) add a file appender to "com.mchange.v2" logger with the
additivity flag set to false.

<logger name="com.mchange.v2" additivity="false">
  <appender-ref name="any appender other than DBAppender">
</logger>

In the absence of other fixes, I am closing this bug as WONTFIX.

> Deadlock with DBAppender
> ------------------------
>
>                 Key: LBCLASSIC-148
>                 URL: http://jira.qos.ch/browse/LBCLASSIC-148
>             Project: logback-classic
>          Issue Type: Bug
>    Affects Versions: 0.917
>         Environment: MacBook Pro 17"
> Intel Core 2 Duo
> 2.33 GHz
> OS X 10.5.7 (9J61)
> java version "1.6.0_13"
> slf4j  1.5.8
> c3p0 0.9.1.2
>            Reporter: Mel T.
>            Assignee: Ceki Gulcu
>            Priority: Critical
>         Attachments: logback2-works.xml, logback2.xml, MainTest.java
>
>
> A deadlock occurs when running the attached application. For this lock to occur, we need to:
>  - load a configuration other than the default in java app.
>  - not have any default logback.xml in the classpath.
>  
> - have these jars in the classpath
>       c3p0-0.9.1.2.jar
>       logback-core-0.9.17.jar
>       logback-classic-0.9.17.jar
>       log4j-over-slf4j-1.5.8.jar
>       slf4j-api-1.5.8.jar
>       mysql.jar
> - Place attached the logback2.xml file in the same package as the attached MainTest class.
> - adapt the logback2.xml file to your DB schema. (note that you do not need to have the DB tables created for the lock to occur, but the test is more conclusive if you have a valid DB connection and schema.)
> - Execute this 
>    java -cp ".:../c3p0-0.9.1.2.jar:../logback-core-0.9.17.jar:../logback-classic-0.9.17.jar:../log4j-over-slf4j-1.5.8.jar:../slf4j-api-1.5.8.jar:../mysql.jar" MainTest
> The application should output the logger status and hang.
> Workaround:
>  - Do not include log4j-over-slf4j in the classpath, 
>  - or add a default logback.xml that will be loaded first (just copy and rename logback2.xml in same default package)
>  - or use the attached logback2-works.xml instead of logback2.xml (modify MainTest to load that file instead.)
> In this last one, the change is that the DB appender is only used in a logger element instead of the root.
> I did not spend the time to look at the cause of this locking problem as the workarounds allow me to move on. So I hope this really belong in jira, and not a config/usage error on my part.
> --
> Mel T.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list