private static void doThreadDump(final HttpServletRequest req,final HttpServletResponse resp) throws IOException {
  resp.setStatus(HTTP_OK);
  resp.addHeader("Cache-Control","no-cache");
  resp.setContentType(MIME_TEXT_PLAIN);
  final PrintWriter w=resp.getWriter();
  try {
    BigdataStatics.threadDump(w);
    w.flush();
  }
 catch (  Throwable t) {
    launderThrowable(t,resp,"");
  }
 finally {
    w.close();
  }
}

private static void doThreadDump ( final HttpServletRequest req , final HttpServletResponse resp ) throws IOException { resp . setStatus ( HTTP_OK ) ; resp . addHeader ( "Cache-Control" , "no-cache" ) ; resp . setContentType ( MIME_TEXT_PLAIN ) ; final PrintWriter w = resp . getWriter ( ) ; try { BigdataStatics . threadDump ( w ) ; w . flush ( ) ; } catch ( Throwable t ) { launderThrowable ( t , resp , "" ) ; } finally { w . close ( ) ; } }
write a thread dump onto the http response as an aid to diagnose both node - local and distributed deadlocks . < p > note : this code should not obtain any locks . this is necessary in order for the code to run even when the server is in a deadlock .
