Bug
When node.serve() is called, the rawServe() polling loop keeps an unresolved Promise alive. This prevents the Deno (and Node.js) process from exiting naturally, even after all user code has finished.
There is no default SIGINT handler registered, so pressing Ctrl+C does not stop the process.
Reproduction
const node = await createNode();
node.serve((req) => new Response("hello"));
// process hangs forever — Ctrl+C does nothing
The only ways to exit are:
- Pass an
AbortSignal to serve({ signal }) and abort it manually
- Call
node.close() explicitly
Neither is documented as required.
Expected behaviour
At minimum, the documentation and/or the getting-started example should show that node.close() / an AbortSignal is required for the process to exit.
Ideally, iroh-http should register a default SIGINT/SIGTERM handler (similar to how Deno.serve() handles this) so that Ctrl+C gracefully shuts down the serve loop and exits. This could be opt-out:
node.serve({ handleSignals: true }, (req) => new Response("hello"));
Affected platforms
- Deno (verified)
- Node.js (likely same issue)
Bug
When
node.serve()is called, therawServe()polling loop keeps an unresolvedPromisealive. This prevents the Deno (and Node.js) process from exiting naturally, even after all user code has finished.There is no default
SIGINThandler registered, so pressing Ctrl+C does not stop the process.Reproduction
The only ways to exit are:
AbortSignaltoserve({ signal })and abort it manuallynode.close()explicitlyNeither is documented as required.
Expected behaviour
At minimum, the documentation and/or the getting-started example should show that
node.close()/ anAbortSignalis required for the process to exit.Ideally, iroh-http should register a default
SIGINT/SIGTERMhandler (similar to howDeno.serve()handles this) so that Ctrl+C gracefully shuts down the serve loop and exits. This could be opt-out:Affected platforms