Skip to content

Requests hanging after previous request.body.read doesn't close #213

@dishcandanty

Description

@dishcandanty

Quick Overview

Previous comment / where this is coming from:
#183 (comment)

I'm experiencing an issue where the body read doesn't seem to close, causing the next request to hang. I suspect its due to a malformed request / bad headers / unusual client.

  • Async::HTTP::Server
  • request.body.read doesn't seem to close
  • request.body.close after request processing solves the issue
  • DragonRuby HTTP Client

Reproduce

I've created a minimal reproduce here with more example/data in the readme code
https://github.com/dishcandanty/server-async-hang-reproduce

Overly simplifying:

  1. Send request
  2. Send second request (hangs on body read)

If the body.close is called, no issue. if the body.read is removed entirely, similarly no issues.

The "http client" where I'm reproducing the hang (haven't been able to reproduce with vanilla curl) is within DragonRuby, specifically using the http_post_body helpers

I haven't been able to reproduce this with vanilla curl even trying to replicate all the request data / headers. Ultimately though, I think its probably a bad thing that some malformed request can indefinitely hold open the server (malicious actors or silly devs doing weird things :D )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions