Repository navigation
Conversation
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.
When a host import fails after
host_task_create, the error now also leaves the host call. Before,call_sync_lowerandcall_async_lowerreturned with?and did not callhost_task_delete. With component-model-async, the current thread stayedDeferredHost(caller)and the deferred call and its call context stayed set. This happens for a host error such asI32Exitfromwasi:cli/exit, and also for a guest error found while the parameters are lifted.A Store that runs more host work after such a trap then fails
debug_assert_deferred_host_invariantinset_thread("a deferred host thread and call context must exist together"). Golem does this: after a tool callswasi:cli/exit, the executor finishes the tool's output streams on the trapped Store withrun_concurrent, which polls a host task that the guest left pending. This is golemcloud/golem#4617.host_task_delete_after_erroris the error dual ofhost_task_create. While the call is still a deferred host call, it makes the caller the current thread again and removes the deferred call and call context, ashost_task_deletedoes. Afterhost_task_delete, or after the call was materialized into a host task, it changes nothing. Without concurrency support it leaves the call scope, ashost_task_deletedoes.call_sync_lowerandcall_async_lowereach split into an outer part, which enters the host task and leaves it on any error, and an*_enteredpart with the original body. The sync part records when it reacheshost_task_delete, so that a call scope is never left twice.failed_host_call_leaves_no_deferred_host_callcovers a host error with sync and async lowering and a lift error with sync lowering. Each case polls the Store again after the trap.Not changed: a host task that is materialized and then fails before the event loop or a subtask owns it (for example
poll_and_blockwhen the caller may not suspend) still stays in the table. That already happens ongolem-wasmtime-v50.0.1-p3.Local checks:
cargo test -p wasmtime --tests,cargo clippy -p wasmtime --all-targets --features component-model-async,cargo check -p wasmtime --no-default-features --features component-model,runtime,cranelift,async, rustfmt. Not run here:tests/allandcomponent-async-tests.