Skip to content

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

Merged
matheus23 merged 1 commit inton0-computer:mainfrom
cbenhagen:fix/iroh-endpoint-close-receive
Mar 25, 2026
Merged

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

Conversation

@cbenhagen
Copy link
Copy Markdown
Contributor

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.

@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
@cbenhagen cbenhagen force-pushed the fix/iroh-endpoint-close-receive branch from 22e5291 to d2a0326 Compare March 24, 2026 18:17
@matheus23 matheus23 merged commit 6eaa506 into n0-computer:main Mar 25, 2026
14 checks passed
@github-project-automation github-project-automation bot moved this from 🚑 Needs Triage to ✅ Done in iroh Mar 25, 2026
@cbenhagen cbenhagen deleted the fix/iroh-endpoint-close-receive branch March 25, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants