<html><head><base href="x-msg://9/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I was just wondering:<div>Doesn't this make commons-io IOUtils.closeQuietly really risky?</div><div><br></div><div>Cheers,</div><div>Jörn.</div><div><br><div><div>On 05.07.2010, at 08:27, Andreas Dejung wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-AU" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">I had the same problem and I think I know why<span class="Apple-converted-space"> </span><span style="font-family: Wingdings; ">J</span><o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">Solaris does interrupt IO blocked thread which then causes the OutputStreamAppender to catch the IOException in line 218 (version 0.9.24). I actually run version 0.9.18 but this part has not change so I guess it will behave the same way.<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">If we look at<span class="Apple-converted-space"> </span><a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4385444" style="color: blue; text-decoration: underline; ">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4385444</a><span class="Apple-converted-space"> </span>InterruptedIOException should not be required by platform specification (sol)<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">And log4j<span class="Apple-converted-space"> </span><a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=44157" style="color: blue; text-decoration: underline; ">https://issues.apache.org/bugzilla/show_bug.cgi?id=44157</a><span class="Apple-converted-space"> </span>InterruptedIOException ignored by log4j<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">I think it should be solved the same why<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> }<span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(127, 0, 85); ">catch</span></b><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "><span class="Apple-converted-space"> </span>(InterruptedIOException iioe){</span><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> <span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(63, 127, 95); ">//give the thread a changes to act on interruption and then carry on</span><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> Thread.currentThread().interrupt();</span><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> }<span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(127, 0, 85); ">catch</span></b><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "><span class="Apple-converted-space"> </span>(IOException ioe) {</span><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> <span class="Apple-converted-space"> </span></span><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(63, 127, 95); ">// as soon as an exception occurs, move to non-started state</span><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> </span><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(63, 127, 95); ">// and add a single ErrorStatus to the SM.</span><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> </span><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> <span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(127, 0, 85); ">this</span></b><span style="font-size: 10pt; font-family: 'Courier New'; color: black; ">.started =<span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(127, 0, 85); ">false</span></b><span style="font-size: 10pt; font-family: 'Courier New'; color: black; ">;</span><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> addStatus(</span><b><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(127, 0, 85); ">new</span></b><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "><span class="Apple-converted-space"> </span>ErrorStatus(</span><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(42, 0, 255); ">"IO failure in appender"</span><span style="font-size: 10pt; font-family: 'Courier New'; color: black; ">,<span class="Apple-converted-space"> </span></span><b><span style="font-size: 10pt; font-family: 'Courier New'; color: rgb(127, 0, 85); ">this</span></b><span style="font-size: 10pt; font-family: 'Courier New'; color: black; ">, ioe));</span><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 10pt; font-family: 'Courier New'; color: black; "> }</span><span style="font-size: 10pt; font-family: 'Courier New'; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">I could not find the jira entry mentioned in this thread therefore I write it here<span class="Apple-converted-space"> </span><span style="font-family: Wingdings; ">J</span><o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">BTY the jvm option –XX:-UseVMInterruptibleIO does prevent the interruption by solaris but that’s only a workaround and not solving the problem ;)<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; ">Cheers Andy<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div>_______________________________________________<br>Logback-user mailing list<br><a href="mailto:Logback-user@qos.ch" style="color: blue; text-decoration: underline; ">Logback-user@qos.ch</a><br><a href="http://qos.ch/mailman/listinfo/logback-user" style="color: blue; text-decoration: underline; ">http://qos.ch/mailman/listinfo/logback-user</a><br></div></span></blockquote></div><br></div></body></html>