Skip to content

Commit

Permalink
fixed LOGBACK-910
Browse files Browse the repository at this point in the history
  • Loading branch information
ceki committed Mar 25, 2015
1 parent e5dc2c5 commit df0e5f9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
Expand Up @@ -155,6 +155,9 @@ private void put(E eventObject) {
try {
blockingQueue.put(eventObject);
} catch (InterruptedException e) {
// Interruption of current thread when in doAppend method should not be consumed
// by AsyncAppender
Thread.currentThread().interrupt();
}
}

Expand Down
Expand Up @@ -227,6 +227,29 @@ public void stopExitsWhenMaxRuntimeReached() throws InterruptedException {
verify(la, loopLen);
}


// Interruption of current thread when in doAppend method should not be consumed
// by async appender. See also http://jira.qos.ch/browse/LOGBACK-910
@Test
public void verifyInterruptionIsNotSwallowed() {
asyncAppenderBase.addAppender(delayingListAppender);
asyncAppenderBase.start();
Thread.currentThread().interrupt();
asyncAppenderBase.doAppend(new Integer(0));
assertTrue(Thread.currentThread().isInterrupted());
// clear flag for next test
Thread.interrupted();
}

@Test
public void verifyInterruptionOfWorkerIsSwallowed() {
asyncAppenderBase.addAppender(delayingListAppender);
asyncAppenderBase.start();
asyncAppenderBase.stop();
assertTrue(asyncAppenderBase.worker.isInterrupted());
}


private void verify(ListAppender<Integer> la, int expectedSize) {
assertFalse(la.isStarted());
assertEquals(expectedSize, la.list.size());
Expand Down
22 changes: 17 additions & 5 deletions logback-site/src/site/pages/news.html
Expand Up @@ -29,14 +29,26 @@ <h2>Logback News</h2>

<hr width="80%" align="center" />

<h3>24th of March 2015, Release of version 1.1.3</h3>

<div class="breaking">
<h4>All logback modules now require JDK 1.6 instead of
previously JDK 1.5. This change was put to consultation on the
logback mailing lists with no objections raised.</h4>
<h4>As of version 1.1.3, all logback modules require JDK 1.6
instead of previously JDK 1.5. This change was put to
consultation on the logback mailing lists with no objections
raised.</h4>
</div>

<h3> 2015, Release of version 1.1.4</h3>

<p><code>AsyncAppenderBase</code> now restores the current
thread's inrerupt flag when catching a
<code>InterruptedException</code>. See . The issue, i.e. <a
href="http://jira.qos.ch/browse/LOGBACK-910">LOGBACK-910</a>, was
raised by Henrik Nordvik who also provided the relevant fix.</p>


<hr width="80%" align="center" />

<h3>24th of March 2015, Release of version 1.1.3</h3>

<p>Fixed <code>FileAppender</code>'s prudent mode so that it properly recovers
from IO Errors
(<a href="http://jira.qos.ch/browse/LOGBACK-1046">LOGBACK-1046</a>) </p>
Expand Down

0 comments on commit df0e5f9

Please sign in to comment.