Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(swingset): make terminateVat() async
The kernel has a function named `terminateVat()`, which is called from both the delivery side (illegal syscall, `syscall.exit`, or meter overflow), and the device side (when someone asks vat-admin to terminate a vat from the outside). Part of this function's job is to shut down any worker that was online. Doing that is an async task. Previously, `terminateVat` was synchronous, and when it shut down the worker, it used `void` to disclaim interest on when exactly the shutdown occurred (as well as any errors encountered). This commit changes `terminateVat` to be `async`, and to wait for that shutdown to finish. This moves the `void` discomfort into `vat-admin-hooks.js`, where a new TODO is a reminder that we need to propagate the async-ness outwards, probably by converting the external shutdown request into a run-queue event, like `create-vat` and `upgrade-vat`.
- Loading branch information