-
Notifications
You must be signed in to change notification settings - Fork 212
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
Changes from all commits
Commits
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 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
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
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.
On seats, we have
exit
vskickOut
to distinguish between exiting for "normal" reasons vs exiting because of a problem. Such problems include circumstances in addition to the contract callingkickOut
. 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 bykickOut
. 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 byexit
rather thankickOut
, 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 akickOut
of all seats.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.
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.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.
Issue created here: #1774