generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 7
kernel: fix lingering ref‑counts that blocked GC #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9f0675c
kernel: fix lingering ref‑counts that blocked GC
sirtimid 5b4db9a
fix typo
sirtimid 2afae67
Add translators test
sirtimid 4ab5b1c
thresholds
sirtimid 96bc9b8
change comment
sirtimid c6a379c
eliminate credit
sirtimid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to pin every root ref (in fact, we absolutely shouldn't) but something like this has to happen somewhere (perhaps
launchSubcluster?) to ensure that references (e.g., to bootstrap vats) that are only held externally (e.g., by the control panel or test scripts) but never explicitly exported via a message parameter are counted, else one's whole subcluster could simply disappear after a GC. (Speaking cosmologically, the universe as a whole is unreferenced.). This can sneak up on you (ask me how I know :-)Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pinky swear that a whole subcluster can't disappear except if one deletes the bootstrap vat after they have deleted all the other vats and have garbage collected them. Shouldn't we support this process? One can't just delete all vats (with the bootstrap) and garbage collect them, the references brake. In other words: the requirement that you retire the secondary vats before you retire the bootstrap is what guarantees safety imo.
Anyway I suggest we do this on another "add removable bootstrap keep‑alive pin" task and perhaps follow agorics convention of pin/unpin. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that that sounds like the right plan to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, subtle point:
It's not that the vat itself gets GC'd, it's that the vat's root object gets GC'd, so unless the vat has in the meantime wired itself up with other vats you lose the ability to talk to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And.. done #494
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, as a general rule, GC'ing a vat's root object while the rest of the vat continues to run is not a problem. At Agoric, it was not uncommon to create a vat with an ephemeral root object whose only job was to initialize things and then go away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha! I didn't expect that, but, yes of course, why not!