Skip to content
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

comms doesn't handle retired promise IDs properly #1534

Closed
warner opened this issue Aug 17, 2020 · 1 comment
Closed

comms doesn't handle retired promise IDs properly #1534

warner opened this issue Aug 17, 2020 · 1 comment
Assignees
Labels
bug Something isn't working SwingSet package: SwingSet

Comments

@warner
Copy link
Member

warner commented Aug 17, 2020

Describe the bug

While building more comprehensive tests for #1404 I found more problems in the comms vat's handling of resolved promises. Our current rule is that when either the kernel or the vat resolves a promise, both sides will retire the promise ID, in the hopes of GCing data sooner. Regular vats implement this in liveslots, but the comms vat is lower level than that and does not use liveslots. The comms vat doesn't correctly retire the vpid in all circumstances.

One case is when machine A sends a message to machine B, aimed at a promise that is known to be decided on B. But before that message can arrive, some vat on B causes the promise to become resolved to an object back on A. We need B to reflect the message back to A in this case, but the comms vat only currently knows how to deliver inbound messages into the kernel.

Another case is when a B-decided promise is resolved on B, and then a message arrives from A that cites the promise in an argument. As the kernel has already forgotten about the promise ID, we must remind it about the contents. We can allocate a new vpid, or re-use the old one (which is easier, as we already have it in the remote table), but after using it the arguments of a send or resolve syscall, we must perform a resolve syscall on the vpid. (and then of course both vat and kernel will forget the value again, so we must do this each time the vpid is used, until the remote end gets the memo, aka the resolution message, and stops using that ID).

The branch I'm working on in #1404 will fix these cases as well. It's got tests for all the cases I could think of.

@warner warner added bug Something isn't working SwingSet package: SwingSet labels Aug 17, 2020
@warner warner self-assigned this Aug 17, 2020
@warner
Copy link
Member Author

warner commented Sep 2, 2020

This should be fixed by #1635

@warner warner closed this as completed Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SwingSet package: SwingSet
Projects
None yet
Development

No branches or pull requests

1 participant