#8502·tokio

Emscripten target runtime keepalive

Author: guybedfordCreated Sep 23, 2026Updated Sep 23, 2026
LabelsC-bugA-tokioM-runtimeT-wasm

Under the Emscripten target, with JSPI as supported in https://github.com/tokio-rs/tokio/pull/8285, blocking on a pending future with no other IO scheduled (rt.block_on(std::future::pending::<()>())), will hit the Node.js event loop exit path despite there being pending work.

We could improve this case by scheduling a timer even for parks without a deadline to ensure that Node.js stays alive on the runtime completion.

Another helpful addition here might be for Emscripten's own internal keepalive mechanism to print a warning when exiting in this case, that there was still unresolved async work.