hyperium / hyperium/hyper

Detecting closed connection race condition

Open
#3,286 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.3k
Forks
1.8k
Avg merge
1d 22h
Merged PRs (30d)
14

Description

Version
current git master

Platform
Linux (any really)

Description
I'm using hyper with curl.

When we do multiple transfers with curl it tries to reuse a connection used in a previous transfer. Persistent connection style. It has a "pool" of previously used connections.

Any such connection in the pool might be closed or otherwise "die" at any given moment.

When curl wants to send a request on a reused connection there is always a risk that it was closed (by the server) just the millisecond before we send the request over the connection.

A key information piece to detect this state is that curl is not able to read a single byte from the connection. If it could read a byte from it, it was not a race condition.

I struggle to get hyper to tell me this information. When hyper deems the response "illegal" very early in the response I get an error back, but how do I know if it errors before reading a single byte?

HYPERE_UNEXPECTED_EOF seems to be returned for more problems than just this.

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

No source file, test, or entry point is named. Start by reproducing the connection-reuse race with hyper and curl, then trace how early response errors are surfaced. Done means establishing and testing a reliable distinction between EOF before any byte is read and other unexpected EOF cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.