<div dir="ltr"><div>Hi, for some weeks we have observed some really mysterious behavior when enabling one of our appenders. This appender was configured specially to use the `FixedWindowRollingPolicy`. What we observed, was that after some time of debug logging, the CPU would suddenly hit the roof and have at least one core fully pegged at 100%. Using Jprofiler we found the issue to be various cases of `logger.debug()` that would be used by this special appender. Disabling the appender immediately fixed the issue (as we have `scan=true`)</div><div><br></div><div>I debugged this yesterday and found the answer partly in the logs and in the logback code. This is the line that basically shows the issue:</div><div><pre style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,"SF Mono",Consolas,"Liberation Mono",Menlo,monospace;font-size:13.6px;margin-top:0px;margin-bottom:0px;padding:16px;overflow:auto;line-height:1.45;border-radius:6px;word-break:normal"><span style="background-color:rgb(243,243,243)"><font color="#000000">   <span class="gmail-pl-k" style="box-sizing:border-box">if</span> (<span class="gmail-pl-k" style="box-sizing:border-box">!</span>file2zip<span class="gmail-pl-k" style="box-sizing:border-box">.</span>delete()) {
        addStatus(<span class="gmail-pl-k" style="box-sizing:border-box">new</span> <span class="gmail-pl-smi" style="box-sizing:border-box">WarnStatus</span>(<span class="gmail-pl-s" style="box-sizing:border-box"><span class="gmail-pl-pds" style="box-sizing:border-box">"</span>Could not delete [<span class="gmail-pl-pds" style="box-sizing:border-box">"</span></span> <span class="gmail-pl-k" style="box-sizing:border-box">+</span> nameOfFile2zip <span class="gmail-pl-k" style="box-sizing:border-box">+</span> <span class="gmail-pl-s" style="box-sizing:border-box"><span class="gmail-pl-pds" style="box-sizing:border-box">"</span>].<span class="gmail-pl-pds" style="box-sizing:border-box">"</span></span>, <span class="gmail-pl-c1" style="box-sizing:border-box">this</span>));
    }</font></span></pre></div><div><br></div><div>The logs were full of this and I also found references to this online. I documented the entire process and findings in this repo: <a href="https://github.com/fatso83/logback-bug">https://github.com/fatso83/logback-bug</a>. The repo also contains a minimal attempt at recreating what I saw on the Windows servers on my local machine. </div><div><br></div><div>I was unable to reproduce this locally, which I kind of need in order to fix this bug. So, I was just wondering if any of you had any tips? What could cause the file to be "locked" / prevented from being deleted? Would it be enough if someone had a read-handle on the file, for instance a log reader like `<a href="https://glogg.bonnefon.org">glogg</a>`? I made sure to close my own programs when looking at this, but there are multiple users that look at these logs.</div><div><br></div><div>There is a single JVM running this app.</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><table cellpadding="0" cellspacing="0" border="0" style="background:none;margin:0px;padding:0px;border:0px;font-stretch:inherit;font-size:16px;line-height:inherit;font-family:proxima-nova,"Helvetica Neue",Helvetica,Arial,sans-serif;vertical-align:baseline;border-collapse:collapse;color:rgb(85,85,85)"><tbody style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline"><tr style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline"><td colspan="2" style="font-family:Arial,Helvetica,sans-serif;padding:0px 0px 5px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:18px;line-height:inherit;vertical-align:baseline;color:rgb(0,151,137)">Carl-Erik Kopseng</td></tr><tr style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline"><td colspan="2" style="font-family:Arial,Helvetica,sans-serif;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:14px;line-height:inherit;vertical-align:baseline;color:rgb(51,51,51)"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline">Senior developer</span></td></tr><tr style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline"><td colspan="2" style="font-family:Arial,Helvetica,sans-serif;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;font-size:14px;line-height:inherit;vertical-align:baseline;color:rgb(51,51,51)"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:700;font-stretch:inherit;font-size:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline">Diffia AS</span></td></tr></tbody></table></div></div></div>