Skip to content

fix(receive): await Endpoint::close for iroh 0.97#124

Open
cbenhagen wants to merge 1 commit inton0-computer:mainfrom
cbenhagen:fix/iroh-endpoint-close-receive
Open

fix(receive): await Endpoint::close for iroh 0.97#124
cbenhagen wants to merge 1 commit inton0-computer:mainfrom
cbenhagen:fix/iroh-endpoint-close-receive

Conversation

@cbenhagen
Copy link

iroh 0.97 no longer closes connections gracefully when an Endpoint is dropped; you’re expected to await endpoint.close() before the last handle goes away (or you get the iroh::socket “dropped without close” error).

receive now clones the endpoint, runs the existing fetch/export logic in an inner async block, then close()s so that path runs on success and on ?/bail! errors. Ctrl+C closes the outer clone before exit. send is unchanged (Router::shutdown() already shuts the stack down).

Diff size: most of it is one extra indent level from wrapping the worker body; the behavioral change is small.

Test: CLI regression with RUST_LOG=iroh::socket=error and stderr checks, plus the usual byte equality check.

iroh 0.97 no longer closes the endpoint on drop; always await close()
after receive work (success or error) and on Ctrl+C.

Add CLI regression test with RUST_LOG=iroh::socket=error to ensure the
ungraceful-drop error is not logged.
@n0bot n0bot bot added this to iroh Mar 21, 2026
@github-project-automation github-project-automation bot moved this to 🚑 Needs Triage in iroh Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚑 Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant