File tree Expand file tree Collapse file tree 3 files changed +43
-5
lines changed
main/java/ch/qos/logback/core
test/java/ch/qos/logback/core
logback-site/src/site/pages Expand file tree Collapse file tree 3 files changed +43
-5
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,9 @@ private void put(E eventObject) {
155
155
try {
156
156
blockingQueue .put (eventObject );
157
157
} catch (InterruptedException e ) {
158
+ // Interruption of current thread when in doAppend method should not be consumed
159
+ // by AsyncAppender
160
+ Thread .currentThread ().interrupt ();
158
161
}
159
162
}
160
163
Original file line number Diff line number Diff line change @@ -227,6 +227,29 @@ public void stopExitsWhenMaxRuntimeReached() throws InterruptedException {
227
227
verify (la , loopLen );
228
228
}
229
229
230
+
231
+ // Interruption of current thread when in doAppend method should not be consumed
232
+ // by async appender. See also http://jira.qos.ch/browse/LOGBACK-910
233
+ @ Test
234
+ public void verifyInterruptionIsNotSwallowed () {
235
+ asyncAppenderBase .addAppender (delayingListAppender );
236
+ asyncAppenderBase .start ();
237
+ Thread .currentThread ().interrupt ();
238
+ asyncAppenderBase .doAppend (new Integer (0 ));
239
+ assertTrue (Thread .currentThread ().isInterrupted ());
240
+ // clear flag for next test
241
+ Thread .interrupted ();
242
+ }
243
+
244
+ @ Test
245
+ public void verifyInterruptionOfWorkerIsSwallowed () {
246
+ asyncAppenderBase .addAppender (delayingListAppender );
247
+ asyncAppenderBase .start ();
248
+ asyncAppenderBase .stop ();
249
+ assertTrue (asyncAppenderBase .worker .isInterrupted ());
250
+ }
251
+
252
+
230
253
private void verify (ListAppender <Integer > la , int expectedSize ) {
231
254
assertFalse (la .isStarted ());
232
255
assertEquals (expectedSize , la .list .size ());
Original file line number Diff line number Diff line change @@ -29,14 +29,26 @@ <h2>Logback News</h2>
29
29
30
30
< hr width ="80% " align ="center " />
31
31
32
- < h3 > 24th of March 2015, Release of version 1.1.3</ h3 >
33
-
34
32
< div class ="breaking ">
35
- < h4 > All logback modules now require JDK 1.6 instead of
36
- previously JDK 1.5. This change was put to consultation on the
37
- logback mailing lists with no objections raised.</ h4 >
33
+ < h4 > As of version 1.1.3, all logback modules require JDK 1.6
34
+ instead of previously JDK 1.5. This change was put to
35
+ consultation on the logback mailing lists with no objections
36
+ raised.</ h4 >
38
37
</ div >
39
38
39
+ < h3 > 2015, Release of version 1.1.4</ h3 >
40
+
41
+ < p > < code > AsyncAppenderBase</ code > now restores the current
42
+ thread's inrerupt flag when catching a
43
+ < code > InterruptedException</ code > . See . The issue, i.e. < a
44
+ href ="http://jira.qos.ch/browse/LOGBACK-910 "> LOGBACK-910</ a > , was
45
+ raised by Henrik Nordvik who also provided the relevant fix.</ p >
46
+
47
+
48
+ < hr width ="80% " align ="center " />
49
+
50
+ < h3 > 24th of March 2015, Release of version 1.1.3</ h3 >
51
+
40
52
< p > Fixed < code > FileAppender</ code > 's prudent mode so that it properly recovers
41
53
from IO Errors
42
54
(< a href ="http://jira.qos.ch/browse/LOGBACK-1046 "> LOGBACK-1046</ a > ) </ p >
You can’t perform that action at this time.
0 commit comments