adamrk opened PR #14343 from adamrk:abk/set-host-task-when-polling to bytecodealliance:main:
When lowering a borrowed resource in a
HostTask, the scope is looked up throughunforced_current_threadin theConcurrentState. But that field only holds theHostTasks ID during the initial poll inpoll_and_blockorfirst_poll. If the task does not resolve on the first poll it will be added to theFuturesUnorderedwithinConcurrentStateto be polled later in the main loop ofpoll_until. But that loop doesn't setunforced_current_threadso any attempt to lower a borrow then will fail to find the required scope.This fixes the issue by setting the thread each time we poll the future in the main loop. Without the fix the added test would fail with the error
BUG: no current scopefromResourceTables::current_scope_id.
adamrk requested dicej for a review on PR #14343.
adamrk requested wasmtime-core-reviewers for a review on PR #14343.
:thumbs_up: dicej submitted PR review:
Thanks, @adamrk!
dicej added PR #14343 async-component-model: Set HostTask when polling to the merge queue.
:check: dicej merged PR #14343.
dicej removed PR #14343 async-component-model: Set HostTask when polling from the merge queue.
Last updated: Sep 20 2026 at 18:08 UTC