-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: tolerate decrefs that arrive after their vat has be deleted
Finalizer callbacks run at strange times, and can occur after the vat which dropped the import has been terminated and cleaned up (so there are no c-list entries left to remove). Ignore these. The unit test is necessarily probablistic. This particular sequence appears to exercise the previously-failing path about 50% of the time. The other 50% of the time it does not, and the test passes without accomplishing anything useful.
- Loading branch information
Showing
4 changed files
with
83 additions
and
9 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 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,24 @@ | ||
import { E } from '@agoric/eventual-send'; | ||
|
||
export function buildRootObject() { | ||
let targetVat; | ||
const theImport = harden({}); | ||
return harden({ | ||
async bootstrap(vats, devices) { | ||
const vatMaker = E(vats.vatAdmin).createVatAdminService(devices.vatAdmin); | ||
targetVat = await E(vatMaker).createVatByName('target'); | ||
// console.log(`target~.one(theImport)`); | ||
// ignore() drops theImport immediately, making it available for GC | ||
}, | ||
|
||
async ignore() { | ||
await E(targetVat.root).ignore(theImport); | ||
// console.log(`sent ignore() done`); | ||
}, | ||
|
||
async terminate() { | ||
await E(targetVat.adminNode).terminateWithFailure('bang'); | ||
// console.log(`sent terminateWithFailure() done`); | ||
}, | ||
}); | ||
} |
File renamed without changes.
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