fix(netwatch): close the socket inline on drop for single-threaded targets - #2
Open
lann wants to merge 1 commit into
Open
fix(netwatch): close the socket inline on drop for single-threaded targets#2lann wants to merge 1 commit into
lann wants to merge 1 commit into
Conversation
…rgets `UdpSocket::drop` defers the libc close to `spawn_blocking`, which panics on wasi (no blocking pool, no worker threads). On `posix_minimal` targets close inline instead — close does not block there. Part of running iroh on wasm32-wasip2 components (polymorph-components/polymorph-iroh#25).
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.
UdpSocket::dropdefers the libc close tospawn_blocking, which panics on wasi (no blocking pool, no worker threads) — the first dropped socket takes the guest down. Onposix_minimaltargets close inline instead; close does not block there.Review notes for an eventual upstream port: (a) as written this also changes espidf (the other
posix_minimaltarget) from deferred to inline close — espidf has threads, so upstream may prefer keying the cfg to wasi alone; (b) behavior when no runtime is current is unchanged in effect (the socket closes either way), the change only moves where the close runs.Branched from
netwatch-v0.19.1(the version iroh main requires) — see polymorph-components/polymorph-iroh#25. Sibling: the posix_minimal wasi routing. Both merged into the long-livedpolymorph-irohbranch the experiments consume.