Git Product home page Git Product logo

ut-read-timeout's Introduction

ut-read-timeout

Test project for investigating an issue with read timeouts being inappropriately triggered in Undertow.

In some cases I have observed the read timeout being triggered on a POST request not in response to an actual read operation exceeding the timeout but because the call/request processing time exceeds the read timeout.

This project produces two war applications:

The first is message-server.war, which contains the endpoint /services/slowpost/generate-random that takes a POST JSON request in this format:

{
    "messageLength": <message-length, 16 by default>
    "sessionId": <session-id, generated if not provided>
    "timeUnit": <time-unit, MILLISECONDS by default>,
    "waitTime": <wait-time, 0 by default>
}

There is also the /services/slowpost/generate-random/{sessionId} endpoint that accepts the same request, but a sessionId can be specified as a URL path parameter, which can make for easier tracking in web access logs.

This will pause for the specified amount of time before generating a random string message and then sending it back in the response.

This is likely the main one needed for testing.

There is a second web app called message-webclient.war that can be used to send requests to the previously mentioned endpoint but either as a GET or POST request, with request parameters (query or form) that match the names shown in the JSON above. I am not sure if this is necessary, but it happened to match the original application structure where I originally observed this. Either the /message-webclient/SlowPostClient or /message-webclient/SlowPostClient/{sessionId} endpoint may be used.

For convenience, the message-webclient.war has an index page at /message-webclient/ that can be used to submit requests to the /SlowPostClient endpoint.

Log messages are placed throughout these applications to show progress, and in the case of message-server.war that even though the request processing can be slow it is NOT reading POST body data.

Recommended logging levels:

  • com.jfisherdev.utreadtimeout at INFO or lower to capture standard logging events that trace different request stages in each app
  • io.undertow.request at TRACE or lower to help capture what is going on in Undertow when the timeout occurs and the channel is closed

Running the deployStandalone task will deploy the WARs to the standalone/deployments directory of a WildFly server, but this application can be deployed however you see fit for testing.

Recreating this issue is NOT as simple as choosing a waitTime that exceeds the configured read timeout, though that is part of it. It seems that there may also need to be concurrent requests with different wait/processing times being made as well.

ut-read-timeout's People

Contributors

jfisherdev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.