Stream: git-wasmtime

Topic: wasmtime / PR #12631 component model: drop borrows when c...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 20 2026 at 23:07):

jellevandenhooff opened PR #12631 from jellevandenhooff:fix-subtask-cancel-borrow-release to bytecodealliance:main:

Update the component model resource tracking to handle cancelling host tasks. I ran into this when cancelling a read on a UDP socket and then trying to drop the socket afterwards. Before this change, that did not work because the cancelled read still held on to the socket.

I debugged this issue and wrote the code with Claude. I've tested this code for my use case and it seems to work, but I don't fully understand the implications. I worry that it might not be safe to release the borrow count because maybe the host function can still run.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 20 2026 at 23:07):

jellevandenhooff requested wasmtime-core-reviewers for a review on PR #12631.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 20 2026 at 23:07):

jellevandenhooff requested alexcrichton for a review on PR #12631.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 20 2026 at 23:16):

jellevandenhooff updated PR #12631.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 20 2026 at 23:26):

jellevandenhooff edited PR #12631:

Update the component model resource tracking to handle cancelling host tasks. Before this change, when cancelling a read on a UDP socket and then dropping the socket failed because of outstanding borrows: the read never released its borrow. Now it does.

I debugged this issue and wrote the code with Claude. I've tested this code for my use case and it seems to work, but I don't fully understand the implications. I worry that it might not be safe to release the borrow count because maybe the host function can still run.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 21 2026 at 02:32):

github-actions[bot] added the label wasmtime:api on PR #12631.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2026 at 16:26):

alexcrichton commented on PR #12631:

Thanks for the PR! Definitely looks like wrong behavior here, especially as the test shows. The fix isn't quite what I would have in mind for this, however, so I'll work a bit locally to see if I can't get something working. I'll likely have a sibling PR to this which includes your test as well. Will post back here when that's ready.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2026 at 18:00):

alexcrichton commented on PR #12631:

Ok I've pushed up a "more official fix" to https://github.com/bytecodealliance/wasmtime/pull/12640 which includes the tests here and should resolve them. Thanks again @jellevandenhooff!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 23 2026 at 18:29):

jellevandenhooff closed without merge PR #12631.


Last updated: Feb 24 2026 at 04:36 UTC