Skip to content

Commit

Permalink
chore(vm-runner): check stop receiver in VM runner main loop (#2209)
Browse files Browse the repository at this point in the history
## What ❔

Ditto

## Why ❔

Faster interruption

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [x] Code has been formatted via `zk fmt` and `zk lint`.
- [x] Spellcheck has been run via `zk spellcheck`.
  • Loading branch information
itegulov authored Jun 11, 2024
1 parent 3538e9c commit b43a881
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/node/vm_runner/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ impl VmRunner {
.await?
+ 1;
loop {
if *stop_receiver.borrow() {
tracing::info!("VM runner was interrupted");
return Ok(());
}

// Traverse all handles and filter out tasks that have been finished. Also propagates
// any panic/error that might have happened during the task's execution.
let mut retained_handles = Vec::new();
Expand Down

0 comments on commit b43a881

Please sign in to comment.