Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 5d8715b

Browse files
committed
remove unnecessary assertion from subtask_cancel
If the task to be cancelled is yielding or was cancelled earlier, then an event will already have been set for that task, which is normal and does not indicate a bug. Fixes #146 Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent 4280e78 commit 5d8715b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/wasmtime/src/runtime/component/concurrent.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2409,7 +2409,9 @@ impl ComponentInstance {
24092409
// Started, but not yet returned or cancelled; send the
24102410
// `CANCELLED` event
24112411
task.cancel_sent = true;
2412-
assert!(task.event.is_none());
2412+
// Note that this might overwrite an event that was set earlier
2413+
// (e.g. `Event::None` if the task is yielding), but that's okay
2414+
// -- we want to overwrite it in that case.
24132415
task.event = Some(Event::Cancelled);
24142416
if let Some(set) = task.waiting_on.take() {
24152417
let item = match self.get_mut(set)?.waiting.remove(&guest_task).unwrap() {

0 commit comments

Comments
 (0)