hyperium / hyperium/hyper

Errors caused by `JoinError::Cancelled` don't return true for `Error::is_canceled`

Open
#2,897 0 comments 2 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
0.14.17

Platform
N/A

Description
When requests are cancelled because of a JoinError::Cancelled error, it is processed in the hyper library as a connection error because the failure is happening during dns resolution, but in this case it seems like it would be more correct for this to be saved as a cancelation, rather than a connection error.

See this debug print of the Error I'm encountering here:
hyper::Error(Connect, ConnectError("dns error", Custom { kind: Interrupted, error: JoinError::Cancelled }))

It would be much more valuable if this were a CancelledError as it would give greater flexibility in distinguishing cancelled JoinHandles from actual connection errors.

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 DNS-resolution error path where JoinError::Cancelled is wrapped as a connection error, then inspect Error::is_canceled and the handling of JoinError::Cancelled. Done means cancellation during DNS resolution is recognized as cancellation rather than a connection error, with coverage for the reported error shape.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.