hyperium / hyperium/hyper

Server idle/read/write timeout support

Open
#1,628 7 comments 21 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-http2 A-server B-rfc C-feature
Dominant language
Rust
Stars
16.3k
Forks
1.8k
Avg merge
1d 22h
Merged PRs (30d)
14

Description

On the server side, it's important to be able to clear out connections that have been idle for too long or are somehow broken. For HTTP/1, this can be done pretty simply by setting stream-level read and write timeouts. However, things aren't so simple for HTTP/2 since it's multiplexed. In particular, the server is always attempting to read from an HTTP/2 socket, so if a single request is active that takes more than the read timeout to process, the connection gets killed.

To handle this properly, I think we'll need hyper-level timeout configuration. In particular, I care about being able to shut down connections that have been idle for some period of time, and detect when reading from a client or writing to it is taking too long.

There are also some potential higher level timeouts to defend against e.g. slow loris attacks by placing a cap on the time a client is allowed to send the complete set of headers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the server-side HTTP/1 and multiplexed HTTP/2 connection handling described in the issue, focusing on how reads, writes, and idle connections are currently managed. Define the timeout configuration and observable behavior for idle, read, write, and complete-header limits before implementing and validating it.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.