Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-419

RequestLimitingHandler doesn't handle client side socket timeouts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.2.0.Final
    • 1.2.0.Beta10
    • Core
    • None
    • Workaround Exists
    • Hide

      Copy the RequestLimitingHandler and RequestLimiting code and add a DefaultResponseListener in addition to the CompletitionListener and to more or less the same thing:

      private final DefaultResponseListener RESPONSE_LISTENER = new DefaultResponseListener() {

      @Override
      public boolean handleDefaultResponse(final HttpServerExchange exchange) {
      final SuspendedRequest task = queue.poll();
      if (task != null)

      { task.exchange.addExchangeCompleteListener(COMPLETION_LISTENER); task.exchange.dispatch(task.next); }

      else

      { decrementRequests(); }

      return true;
      }
      };

      I am not sure if that is the correct solution but it works for me. Let me know if I shall send a PR for this.

      Show
      Copy the RequestLimitingHandler and RequestLimiting code and add a DefaultResponseListener in addition to the CompletitionListener and to more or less the same thing: private final DefaultResponseListener RESPONSE_LISTENER = new DefaultResponseListener() { @Override public boolean handleDefaultResponse(final HttpServerExchange exchange) { final SuspendedRequest task = queue.poll(); if (task != null) { task.exchange.addExchangeCompleteListener(COMPLETION_LISTENER); task.exchange.dispatch(task.next); } else { decrementRequests(); } return true; } }; I am not sure if that is the correct solution but it works for me. Let me know if I shall send a PR for this.

      The RequestLimitingHandler allows to specify a maximum of concurrent request as well as a queue size.

      Problem Description:
      In case requests are queued and a client(s) closes the connection, say because of client side socket timeout, these requests are not taken from the queue, and to also not proceed with the next requests in the queue.

      In this state, no request are processed anymore (the request are never released from the queue).

      Note that there are servlets involved in my case. Perhaps this information is relevant.

            sdouglas1@redhat.com Stuart Douglas
            rbattenfeld Ralf Battenfeld (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: