-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cope with delivery failures after replay due to dead vats
- Loading branch information
Showing
6 changed files
with
113 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
packages/SwingSet/test/vat-admin/terminate/bootstrap-speak-to-dead.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* global harden */ | ||
import { E } from '@agoric/eventual-send'; | ||
|
||
export function buildRootObject(vatPowers) { | ||
const { testLog } = vatPowers; | ||
let mediumRoot; | ||
let weatherwaxRoot; | ||
|
||
const self = harden({ | ||
async bootstrap(vats, devices) { | ||
const vatMaker = E(vats.vatAdmin).createVatAdminService(devices.vatAdmin); | ||
mediumRoot = vats.medium; | ||
|
||
// create a dynamic vat, then kill it, then try to send it a message | ||
|
||
const weatherwax = await E(vatMaker).createVatByName('weatherwax'); | ||
weatherwaxRoot = weatherwax.root; | ||
|
||
E(weatherwax.adminNode).terminate(); | ||
await E(weatherwax.adminNode).done(); | ||
|
||
try { | ||
await E(mediumRoot).speak(weatherwaxRoot, '1'); | ||
} catch (e) { | ||
testLog(`speak failed: ${e}`); | ||
} | ||
|
||
return 'bootstrap done'; | ||
}, | ||
async speakAgain() { | ||
try { | ||
await E(mediumRoot).speak(weatherwaxRoot, '2'); | ||
} catch (e) { | ||
testLog(`respeak failed: ${e}`); | ||
} | ||
}, | ||
}); | ||
return self; | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/SwingSet/test/vat-admin/terminate/swingset-speak-to-dead.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"bootstrap": "bootstrap", | ||
"bundles": { | ||
"weatherwax": { | ||
"sourceSpec": "vat-weatherwax-terminate.js" | ||
} | ||
}, | ||
"vats": { | ||
"bootstrap": { | ||
"sourceSpec": "bootstrap-speak-to-dead.js" | ||
}, | ||
"medium": { | ||
"sourceSpec": "vat-medium-terminate.js" | ||
} | ||
} | ||
} |
This file contains 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
16 changes: 16 additions & 0 deletions
16
packages/SwingSet/test/vat-admin/terminate/vat-medium-terminate.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* global harden */ | ||
import { E } from '@agoric/eventual-send'; | ||
|
||
export function buildRootObject(vatPowers) { | ||
const { testLog } = vatPowers; | ||
|
||
return harden({ | ||
async speak(target, tag) { | ||
try { | ||
await E(target).live(); | ||
} catch (e) { | ||
testLog(`live ${tag} failed: ${e}`); | ||
} | ||
}, | ||
}); | ||
} |