title: How to debug unexplained thread interruption in Java
body: <p>I'm getting an <code>InterruptedException</code> from Jenkins, relevant part of stack trace:</p>
  
  <pre><code>java.lang.InterruptedException
      at java.lang.Object.wait(Native Method)
      at hudson.remoting.Request.call(Request.java:127)
      at hudson.remoting.Channel.call(Channel.java:646)
      at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:158)
      at $Proxy33.join(Unknown Source)
      at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:861)
  </code></pre>
  
  <p>That interrupt is unexpected and so far unexplained. I can't make that happen under debugger practically, it only happens in a CI which is in production use, and it happens fairly rarely, in well under 1% of Jenkins job executions. Combing through various logs hasn't yielded any useful hints of the cause so far. The remote Jenkins node did not seem to have disconnection at that time.</p>
  
  <p>Question: How to find out the cause of that InterruptedException, or anything else potentially useful, with above constraints?</p>
  
  <p>Any other ideas for tracking down cause of such an exception are also welcome!  Perhaps something Jenkins/Hudson specific, not covered by <a href="https://stackoverflow.com/questions/2476002/who-interrupts-my-thread">this earlier question</a> (answers of that aren't really helpful here).</p>