Skip to content

Commit

Permalink
fix(swingset): when a static vat dies, tolerate lack of next-of-kin
Browse files Browse the repository at this point in the history
`vatTerminated()` was choking during test-syscall-failure.js, because it want
to find a Promise to resolve/reject, and static vats don't have a creator
waiting to be notified about their death.

This replaces the ugly internal error with a simple warning. The death of a
static vat means something has gone seriously wrong, and we should consider
halting the kernel, but this internal error was not the right way to display
it.
  • Loading branch information
warner committed Apr 21, 2021
1 parent 80898e1 commit 215dfb9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/SwingSet/src/kernel/vatAdmin/vatAdminWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ export function buildRootObject(vatPowers) {

// the kernel sends this when the vat halts
function vatTerminated(vatID, shouldReject, info) {
if (!running.has(vatID)) {
// a static vat terminated, so we have nobody to notify
console.log(`DANGER: static vat ${vatID} terminated`);
// TODO: consider halting the kernel if this happens, static vats
// aren't supposed to just keel over and die
return;
}
const { resolve, reject } = running.get(vatID);
running.delete(vatID);
if (shouldReject) {
Expand Down

0 comments on commit 215dfb9

Please sign in to comment.