<style>
/* Changing the layout to use less space for mobiles */
@media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) {
    #email-body { min-width: 30em !important; }
    #email-page { padding: 8px !important; }
    #email-banner { padding: 8px 8px 0 8px !important; }
    #email-avatar { margin: 1px 8px 8px 0 !important; padding: 0 !important; }
    #email-fields { padding: 0 8px 8px 8px !important; }
    #email-gutter { width: 0 !important; }
}
</style>
<div id="email-body">
<table id="email-wrap" align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#f0f0f0;color:#000000;width:100%;">
    <tr valign="top">
        <td id="email-page" style="padding:16px !important;">
            <table align="center" border="0" cellpadding="0" cellspacing="0" style="background-color:#ffffff;border:1px solid #bbbbbb;color:#000000;width:100%;">
                <tr valign="top">
                    <td bgcolor="#003366" style="background-color:#003366;color:#ffffff;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;line-height:1;"><img src="http://jira.qos.ch/s/en_USb9v8he-418945332/850/25/_/jira-logo-scaled.png" alt="" style="vertical-align:top;" /></td>
                </tr><tr valign="top">
    <td id="email-banner" style="padding:32px 32px 0 32px;">
        
                
        
        
            <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="width:100%;">
    <tr valign="top">
        <td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;padding:0;">
                                        <img id="email-avatar" src="http://jira.qos.ch/secure/useravatar?avatarId=10122" alt="" height="48" width="48" border="0" align="left" style="padding:0;margin: 0 16px 16px 0;" />
                        <div id="email-action" style="padding: 0 0 8px 0;font-size:12px;line-height:18px;">
                                    <a class="user-hover" rel="arndh" id="email_arndh" href="http://jira.qos.ch/secure/ViewProfile.jspa?name=arndh" style="color:#326ca6;">Arnd Hannemann</a>
     created <img src="http://jira.qos.ch/images/icons/issuetypes/bug.png" height="16" width="16" border="0" align="absmiddle" alt="Bug"> <a style='color:#326ca6;text-decoration:none;' href='http://jira.qos.ch/browse/LOGBACK-896'>LOGBACK-896</a>
            </div>
                        <div id="email-summary" style="font-size:16px;line-height:20px;padding:2px 0 16px 0;">
                <a style='color:#326ca6;text-decoration:none;' href='http://jira.qos.ch/browse/LOGBACK-896'><strong>SocketAppender causes Deadlock</strong></a>
            </div>
                    </td>
    </tr>
</table>
    </td>
</tr>
<tr valign="top">
    <td id="email-fields" style="padding:0 32px 32px 32px;">
        <table border="0" cellpadding="0" cellspacing="0" style="padding:0;text-align:left;width:100%;" width="100%">
            <tr valign="top">
                <td id="email-gutter" style="width:64px;white-space:nowrap;"></td>
                <td>
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr valign="top">
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
        <strong style="font-weight:normal;color:#505050;">Issue Type:</strong>
    </td>
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
                <img src="http://jira.qos.ch/images/icons/issuetypes/bug.png" height="16" width="16" border="0" align="absmiddle" alt="Bug">        Bug
    </td>
</tr>                        <tr valign="top">
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
        <strong style="font-weight:normal;color:#505050;">Affects Versions:</strong>
    </td>
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
                    1.0.13            </td>
</tr>
                        <tr valign="top">
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
        <strong style="font-weight:normal;color:#505050;">Assignee:</strong>
    </td>
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
                                        <a class="user-hover" rel="logback-dev@qos.ch" id="email_logback-dev@qos.ch" href="http://jira.qos.ch/secure/ViewProfile.jspa?name=logback-dev%40qos.ch" style="color:#326ca6;">Logback dev list</a>
                </td>
</tr>                                                                        <tr valign="top">
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
        <strong style="font-weight:normal;color:#505050;">Created:</strong>
    </td>
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
        26/Aug/13 9:14 PM
    </td>
</tr>                        <tr valign="top">
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
        <strong style="font-weight:normal;color:#505050;">Description:</strong>
    </td>
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
        <p style='margin-top:0;margin-bottom:10px;'>Logback hinders program to exit, when SocketAppender is used.<br/>
Very easy to reproduce.<br/>
Take the following Example Program:</p>

<p style='margin-top:0;margin-bottom:10px;'>import org.slf4j.Logger;<br/>
import org.slf4j.LoggerFactory;</p>

<p style='margin-top:0;margin-bottom:10px;'>public class Hello {</p>

<p style='margin-top:0;margin-bottom:10px;'>  public static void main(String[] args) </p>
{

    Logger logger = LoggerFactory.getLogger("blub");
        logger.debug("Hello world.");

  }
<p style='margin-top:0;margin-bottom:10px;'>}</p>

<p style='margin-top:0;margin-bottom:10px;'>with the following logback.xml:</p>

<p style='margin-top:0;margin-bottom:10px;'><configuration scan="true" scanPeriod="60 seconds" debug="true"><br/>
        <appender name="test" class="ch.qos.logback.classic.net.SocketAppender"><br/>
                <remoteHost>localhost</remoteHost><br/>
                <port>5514</port><br/>
        </appender><br/>
</configuration></p>


<p style='margin-top:0;margin-bottom:10px;'>Now run it with 1.0.13 and JVM hangs:<br/>
java -cp slf4j-api-1.7.5.jar:logback-core-1.0.13.jar:logback-classic-1.0.13.jar:. Hello<br/>
21:04:01,307 |-INFO in ch.qos.logback.classic.LoggerContext<span class="error">[default]</span> - Could NOT find resource <span class="error">[logback.groovy]</span><br/>
21:04:01,307 |-INFO in ch.qos.logback.classic.LoggerContext<span class="error">[default]</span> - Could NOT find resource <span class="error">[logback-test.xml]</span><br/>
21:04:01,307 |-INFO in ch.qos.logback.classic.LoggerContext<span class="error">[default]</span> - Found resource <span class="error">[logback.xml]</span> at <a href="file:/home/arnd/java/logback-1.0.13/logback.xml" class="external-link">file:/home/arnd/java/logback-1.0.13/logback.xml</a><br/>
21:04:01,417 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Setting ReconfigureOnChangeFilter scanning period to 1 minutes<br/>
21:04:01,418 |-INFO in ReconfigureOnChangeFilter</p>
{invocationCounter=0}
<p style='margin-top:0;margin-bottom:10px;'> - Will scan for changes in [<span class="error">[/home/arnd/java/logback-1.0.13/logback.xml]</span>] every 60 seconds. <br/>
21:04:01,418 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - Adding ReconfigureOnChangeFilter as a turbo filter<br/>
21:04:01,422 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type <span class="error">[ch.qos.logback.classic.net.SocketAppender]</span><br/>
21:04:01,427 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as <span class="error">[test]</span><br/>
21:04:01,466 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.<br/>
21:04:01,468 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@47fe5853 - Registering current configuration as safe fallback point<br/>
21:04:01,474 |-WARN in Logger<span class="error">[blub]</span> - No appenders present in context <span class="error">[default]</span> for logger <span class="error">[blub]</span>.<br/>
21:04:01,475 |-INFO in ch.qos.logback.classic.net.SocketAppender<span class="error">[test]</span> - remote peer localhost:5514: connection established</p>


<p style='margin-top:0;margin-bottom:10px;'>Stacktrace shows, a Thread "hanging" in ch.qos.logback.core.net.AbstractSocketAppender.dispatchEvents:</p>

<p style='margin-top:0;margin-bottom:10px;'>Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.25-b01 mixed mode):</p>

<p style='margin-top:0;margin-bottom:10px;'>"DestroyJavaVM" prio=10 tid=0x00007f713c008800 nid=0x33af waiting on condition <span class="error">[0x0000000000000000]</span><br/>
   java.lang.Thread.State: RUNNABLE</p>

<p style='margin-top:0;margin-bottom:10px;'>"pool-1-thread-1" prio=10 tid=0x00007f713c297000 nid=0x33bc waiting on condition <span class="error">[0x00007f71299b3000]</span><br/>
   java.lang.Thread.State: WAITING (parking)<br/>
        at sun.misc.Unsafe.park(Native Method)</p>
<ul class="alternate" type="square">
        <li>parking to wait for  <0x00000000d7c3d3d0> (a java.util.concurrent.SynchronousQueue$TransferStack)<br/>
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)<br/>
        at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:458)<br/>
        at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)<br/>
        at java.util.concurrent.SynchronousQueue.take(SynchronousQueue.java:925)<br/>
        at ch.qos.logback.core.net.AbstractSocketAppender.dispatchEvents(AbstractSocketAppender.java:234)<br/>
        at ch.qos.logback.core.net.AbstractSocketAppender.run(AbstractSocketAppender.java:191)<br/>
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)<br/>
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)<br/>
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)<br/>
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)<br/>
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)<br/>
        at java.lang.Thread.run(Thread.java:724)</li>
</ul>


<p style='margin-top:0;margin-bottom:10px;'>"Service Thread" daemon prio=10 tid=0x00007f713c0f1800 nid=0x33ba runnable <span class="error">[0x0000000000000000]</span><br/>
   java.lang.Thread.State: RUNNABLE</p>

<p style='margin-top:0;margin-bottom:10px;'>"C2 CompilerThread1" daemon prio=10 tid=0x00007f713c0ef000 nid=0x33b9 waiting on condition <span class="error">[0x0000000000000000]</span><br/>
   java.lang.Thread.State: RUNNABLE</p>

<p style='margin-top:0;margin-bottom:10px;'>"C2 CompilerThread0" daemon prio=10 tid=0x00007f713c0ec800 nid=0x33b8 waiting on condition <span class="error">[0x0000000000000000]</span><br/>
   java.lang.Thread.State: RUNNABLE</p>

<p style='margin-top:0;margin-bottom:10px;'>"Signal Dispatcher" daemon prio=10 tid=0x00007f713c0ea000 nid=0x33b7 waiting on condition <span class="error">[0x0000000000000000]</span><br/>
   java.lang.Thread.State: RUNNABLE</p>

<p style='margin-top:0;margin-bottom:10px;'>"Finalizer" daemon prio=10 tid=0x00007f713c09c000 nid=0x33b6 in Object.wait() <span class="error">[0x00007f712a81e000]</span><br/>
   java.lang.Thread.State: WAITING (on object monitor)<br/>
        at java.lang.Object.wait(Native Method)</p>
<ul class="alternate" type="square">
        <li>waiting on <0x00000000d7765798> (a java.lang.ref.ReferenceQueue$Lock)<br/>
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)</li>
        <li>locked <0x00000000d7765798> (a java.lang.ref.ReferenceQueue$Lock)<br/>
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)<br/>
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:189)</li>
</ul>


<p style='margin-top:0;margin-bottom:10px;'>"Reference Handler" daemon prio=10 tid=0x00007f713c099800 nid=0x33b5 in Object.wait() <span class="error">[0x00007f712a91f000]</span><br/>
   java.lang.Thread.State: WAITING (on object monitor)<br/>
        at java.lang.Object.wait(Native Method)</p>
<ul class="alternate" type="square">
        <li>waiting on <0x00000000d7765320> (a java.lang.ref.Reference$Lock)<br/>
        at java.lang.Object.wait(Object.java:503)<br/>
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)</li>
        <li>locked <0x00000000d7765320> (a java.lang.ref.Reference$Lock)</li>
</ul>


<p style='margin-top:0;margin-bottom:10px;'>"VM Thread" prio=10 tid=0x00007f713c092000 nid=0x33b4 runnable </p>

<p style='margin-top:0;margin-bottom:10px;'>"GC task thread#0 (ParallelGC)" prio=10 tid=0x00007f713c016800 nid=0x33b0 runnable </p>

<p style='margin-top:0;margin-bottom:10px;'>"GC task thread#1 (ParallelGC)" prio=10 tid=0x00007f713c018800 nid=0x33b1 runnable </p>

<p style='margin-top:0;margin-bottom:10px;'>"GC task thread#2 (ParallelGC)" prio=10 tid=0x00007f713c01a000 nid=0x33b2 runnable </p>

<p style='margin-top:0;margin-bottom:10px;'>"GC task thread#3 (ParallelGC)" prio=10 tid=0x00007f713c01c000 nid=0x33b3 runnable </p>

<p style='margin-top:0;margin-bottom:10px;'>"VM Periodic Task Thread" prio=10 tid=0x00007f713c0fc800 nid=0x33bb waiting on condition </p>

<p style='margin-top:0;margin-bottom:10px;'>JNI global references: 199</p>

<p style='margin-top:0;margin-bottom:10px;'>Heap<br/>
 PSYoungGen      total 36288K, used 7542K [0x00000000d7760000, 0x00000000d9fe0000, 0x0000000100000000)<br/>
  eden space 31104K, 24% used [0x00000000d7760000,0x00000000d7ebdb40,0x00000000d95c0000)<br/>
  from space 5184K, 0% used [0x00000000d9ad0000,0x00000000d9ad0000,0x00000000d9fe0000)<br/>
  to   space 5184K, 0% used [0x00000000d95c0000,0x00000000d95c0000,0x00000000d9ad0000)<br/>
 ParOldGen       total 83072K, used 0K [0x0000000086600000, 0x000000008b720000, 0x00000000d7760000)<br/>
  object space 83072K, 0% used [0x0000000086600000,0x0000000086600000,0x000000008b720000)<br/>
 PSPermGen       total 21248K, used 6849K [0x0000000081400000, 0x00000000828c0000, 0x0000000086600000)<br/>
  object space 21248K, 32% used [0x0000000081400000,0x0000000081ab05a0,0x00000000828c0000)</p>
    </td>
</tr>
                                                <tr valign="top">
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
        <strong style="font-weight:normal;color:#505050;">Environment:</strong>
    </td>
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
        <p style='margin-top:0;margin-bottom:10px;'>Ubuntu 13.04, Java7</p>
    </td>
</tr>
                                                <tr valign="top">
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
        <strong style="font-weight:normal;color:#505050;">Project:</strong>
    </td>
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
        <a style="color:#326ca6;" href="http://jira.qos.ch/browse/LOGBACK">logback</a>
    </td>
</tr>                                                <tr valign="top">
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
        <strong style="font-weight:normal;color:#505050;">Priority:</strong>
    </td>
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
                        <img src="http://jira.qos.ch/images/icons/priorities/major.png" height="16" width="16" border="0" align="absmiddle" alt="Major">                Major
    </td>
</tr>
                        <tr valign="top">
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 10px 10px 0;white-space:nowrap;">
        <strong style="font-weight:normal;color:#505050;">Reporter:</strong>
    </td>
    <td style="color:#000000;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:12px;padding:0 0 10px 0;width:100%;">
                                        <a class="user-hover" rel="arndh" id="email_arndh" href="http://jira.qos.ch/secure/ViewProfile.jspa?name=arndh" style="color:#326ca6;">Arnd Hannemann</a>
                </td>
</tr>                                                                    </table>
                </td>
            </tr>
        </table>
    </td>
</tr>













            </table>
        </td><!-- End #email-page -->
    </tr>
    <tr valign="top">
        <td style="color:#505050;font-family:Arial,FreeSans,Helvetica,sans-serif;font-size:10px;line-height:14px;padding: 0 16px 16px 16px;text-align:center;">
            This message is automatically generated by JIRA.<br />
            If you think it was sent incorrectly, please contact your JIRA administrators<br />
            For more information on JIRA, see: <a style='color:#326ca6;' href='http://www.atlassian.com/software/jira'>http://www.atlassian.com/software/jira</a>
        </td>
    </tr>
</table><!-- End #email-wrap -->
</div><!-- End #email-body -->