Class StuckThreadDetectionHandler

java.lang.Object
io.undertow.server.handlers.StuckThreadDetectionHandler
All Implemented Interfaces:
HttpHandler

public class StuckThreadDetectionHandler extends Object implements HttpHandler
This valve allows to detect requests that take a long time to process, which might indicate that the thread that is processing it is stuck. Based on code proposed by TomLu in Bugzilla entry #50306
Author:
slaurent
  • Field Details

  • Constructor Details

    • StuckThreadDetectionHandler

      public StuckThreadDetectionHandler(HttpHandler next)
    • StuckThreadDetectionHandler

      public StuckThreadDetectionHandler(int threshold, HttpHandler next)
  • Method Details

    • getThreshold

      public int getThreshold()
      Returns:
      The current threshold in seconds
    • handleRequest

      public void handleRequest(HttpServerExchange exchange) throws Exception
      Handle the request.
      Specified by:
      handleRequest in interface HttpHandler
      Parameters:
      exchange - the HTTP request/response exchange
      Throws:
      Exception
    • getStuckThreadIds

      public long[] getStuckThreadIds()
    • toString

      public String toString()
      Overrides:
      toString in class Object