fix: Use futures-timer instead of tokio's timer for stream timeouts#6488
Merged
mergify[bot] merged 4 commits intoJun 19, 2026
Merged
Conversation
added 2 commits
June 16, 2026 14:37
`futures_bounded::Delay::tokio` compiles on `wasm32-unknown-unknown` (tokio's `time` feature builds there) but panics at runtime: in the browser, futures are driven by `wasm-bindgen-futures` rather than a tokio runtime, so there is no tokio timer driver and `tokio::time::sleep` panics the first time it is polled. tokio's timer fundamentally cannot run on that target. Switch the workspace `futures-bounded` dependency to the `futures-timer` feature and replace every `Delay::tokio(..)` with `Delay::futures_timer(..)` across autonat, dcutr, identify, kad, perf, relay and request-response. `futures-timer` works on both native and wasm — it already backs the project's wasm timers via `gloo-timers` (see the `wasm-bindgen-futures` pin in the root `Cargo.toml`).
dariusc93
approved these changes
Jun 17, 2026
Contributor
|
Queued — the merge queue status continues in this comment ↓. |
Contributor
Merge Queue Status
This pull request spent 1 hour 8 minutes 6 seconds in the queue, including 1 hour 7 minutes 48 seconds running CI. Required conditions to merge
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
futures_bounded::Delay::tokiocompiles onwasm32-unknown-unknown(tokio'stimefeature builds there) but panics at runtime: in the browser, futures are driven bywasm-bindgen-futuresrather than a tokio runtime, so there is no tokio timer driver andtokio::time::sleeppanics the first time it is polled. tokio's timer fundamentally cannot run on that target.Switch the workspace
futures-boundeddependency to thefutures-timerfeature and replace everyDelay::tokio(..)withDelay::futures_timer(..)across autonat, dcutr, identify, kad, perf, relay and request-response.futures-timerworks on both native and wasm — it already backs the project's wasm timers viagloo-timers(see thewasm-bindgen-futurespin in the rootCargo.toml).AI Assistance Disclosure
Tools used (required — write
noneif no AI was used): e.g. none / Claude Code / Copilot / Cursor / ChatGPTClaude Code w/ Opus 4.8 1M context
Attestation (required):
Description section was written by Claude, the rest of the PR description by me.
Notes & open questions
This removes Tokio timer integration even on native builds. I believe that would primarily be used in tests, but none seem to depend on it.
Change checklist