hyperium / hyperium/hyper

hyper-util: client connection pool won't clean expired connections after system sleep

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

Nobody has claimed this yet.

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

Description

Version
hyper-util v0.1.10 (latest)

Platform
x86_64 GNU/Linux

Description
std::Instant has incorrect behavior after system sleep, see https://github.com/rust-lang/rust/issues/79462

This will break some duration calculations, e.g. hyper-util client connection pool won't clean expired connections after system sleep because the new Instant::now is incorrect and the calculated duration is shorter than the actual one. See https://github.com/hyperium/hyper-util/blob/dce81a0cbae0dd989caab74b83be953e75c5cfb1/src/client/legacy/pool.rs#L760

Using https://github.com/DXist/boot-time/ or calling libc to get a time directly may solve 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

Start in hyper-util's src/client/legacy/pool.rs around line 760 and review how std::time::Instant is used when calculating connection expiration. Investigate the linked Rust Instant behavior after system sleep and compare the issue's boot-time and libc alternatives. Done means expired client connections are cleaned up correctly after system sleep.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.