Stream: git-wasmtime

Topic: wasmtime / PR #14266 Synchronize with destroying spawned ...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 23:59):

alexcrichton opened PR #14266 from alexcrichton:synchronize-more-tasks to bytecodealliance:main:

This commit fixes a test failure I'm running into in wasi-libc development where spawned tasks for wasip2 are keeping objects alive in a race condition where sometimes the task is torn down and sometimes it's not. Specifically wasip2 is built on wasip3-style primitives for UDP/TCP which means that futures are used, and if futures aren't immediately ready they're resolved in a spawned Tokio task. This spawned task can interact with UDP, for example, where exclusivity of a UDP socket is tested via Arc::get_mut which will nondeterministically return true or false depending if a previously spawned task has exited or not. In wasi-libc this means that reconnecting a UDP socket sometimes fails and sometimes passes because the background task may or may not have exited.

Here this is resolved by making the drop methods async and then hooking into the preexisting cancel method which aborts the task and then waits on the result. This synchronizes with the task to ensure that the state of the socket is guaranteed to be exclusive after a disconnect and ready for another connect. This similar fix is then applied to ip-name-lookup as well.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.md

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 23:59):

alexcrichton requested rvolosatovs for a review on PR #14266.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 23:59):

alexcrichton requested wasmtime-wasi-reviewers for a review on PR #14266.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 23:59):

alexcrichton requested pchickey for a review on PR #14266.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 01 2026 at 23:59):

alexcrichton requested wasmtime-core-reviewers for a review on PR #14266.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 03:46):

github-actions[bot] added the label wasi on PR #14266.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 11:54):

:thumbs_up: rvolosatovs submitted PR review:

Looks good to me, however it looks like the ip-name-lookup will need a sync module added for p2

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 11:54):

:speech_balloon: rvolosatovs created PR review comment:

looks like this will require adding a sync module adding a non-async fn drop using in_tokio, like we do for UDP already

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 11:54):

:speech_balloon: rvolosatovs created PR review comment:

should this comment be updated?

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 11:55):

:speech_balloon: rvolosatovs edited PR review comment.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 16:06):

alexcrichton updated PR #14266.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 16:06):

alexcrichton has enabled auto merge for PR #14266.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 17:11):

alexcrichton added PR #14266 Synchronize with destroying spawned tasks more in wasip2 to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 17:19):

github-merge-queue[bot] removed PR #14266 Synchronize with destroying spawned tasks more in wasip2 from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 18:02):

alexcrichton updated PR #14266.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 18:02):

alexcrichton has enabled auto merge for PR #14266.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 18:12):

alexcrichton added PR #14266 Synchronize with destroying spawned tasks more in wasip2 to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 18:39):

:check: alexcrichton merged PR #14266.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 02 2026 at 18:39):

alexcrichton removed PR #14266 Synchronize with destroying spawned tasks more in wasip2 from the merge queue.


Last updated: Sep 20 2026 at 18:08 UTC