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

fix: stop accepting offers if zcf.shutdown is called #1772

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

katelynsills
Copy link
Contributor

Closes #1756

This PR makes it such that Zoe no longer accepts offers for instances that have been shutdown

@katelynsills katelynsills added the Zoe package: Zoe label Sep 15, 2020
@katelynsills katelynsills self-assigned this Sep 15, 2020
@katelynsills katelynsills force-pushed the 1756-stop-accepting-offers branch from a70095f to b3857cd Compare September 15, 2020 23:59
Copy link
Member

@erights erights left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The one fix I suggest is for a behavior that is not new as of this PR, but which this PR caused me to notice. Therefore, it is ok if it is not fixed as of this PR. But I would like your thoughts on it. And please file as issue if you agree that this is a genuine problem.

() => instanceAdmin.exitAllSeats(),
() => instanceAdmin.exitAllSeats(),
() => instanceAdmin.shutdown(),
() => instanceAdmin.shutdown(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On seats, we have exit vs kickOut to distinguish between exiting for "normal" reasons vs exiting because of a problem. Such problems include circumstances in addition to the contract calling kickOut. For example, if an offerHandler's returned promise rejects, the seat is kicked out with the rejection reason, which is good.

IIUC, if the zcf vat crashes, the rejection handler above is called with an error representing the reason for crash. But the resulting shutdown ignores this reason and exits all the seats as if by exit rather than as if by kickOut. This is a false-successful-exit inconsistency.

Going the other way, on an explicit call to zcf.shutdown(), all the seats already created exit as if by exit rather than kickOut, which seems good. But any offer made after shutdown causes the offer to be rejected. We might view the later as a false-problematic-exit inconsistency. Or at least race condition.

I suggest that we fix the first inconsistency. But I suggest we document rather than "fix" the latter race condition, as I don't see a fix that's actually better than the current behavior.

I note that the one fix I suggest, to the rejection-handler behavior above, is not new as of this PR. Therefore, it is ok if it is not fixed as of this PR.

When we do address these, we may also want to introduce a shutdown variant that the contract can explicitly call to say "I'm shutting down abnormally because of the following problem", where that variant would also result in a kickOut of all seats.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds good to me. The shutdown variant you describe should be a good fix for the first issue, in that we can hook it up to the rejection handler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue created here: #1774

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Zoe package: Zoe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No offers should be accepted after zcf.shutdown()
2 participants