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

Add a barrier constraining execution order for notifications. #21

Closed
wants to merge 13 commits into from

Conversation

creachadair
Copy link
Owner

@creachadair creachadair commented Jul 11, 2020

An attempt to address #20.

When issuing a batch of requests, keep track of the number that are valid notifications, and do not issue to any handler for the batch until all notifications received in previous batches have completed.

This ensures a sensible partial order on notifications. Multiple notifications in a single batch can still be executed in parallel, but notifications across batches are no longer concurrent.

TODO before merging:

Update the batch call test to verify that the reply to a batch containing a
notification correctly omits the notification.
This test exercises the problem described in #20, where notification handlers
can issue out of order relative to their receipt. At this commit the test fails.
When issuing a batch of requests, keep track of the number that are valid
notifications, and do not issue to any handler for the batch until all
notifications received in previous batches have completed.

This ensures a sensible partial order on notifications. Multiple notifications
in a single batch can still be executed in parallel, but notifications across
batches are no longer concurrent.
When the channel to the client closes, the server discards any calls that are
pending in the queue, but retains notifications. The logic for pruning the
queue was incorrect, and would handle items in the wrong order.
@creachadair
Copy link
Owner Author

GitHub seems to have lost sync between the branch and the PR. I'm going to try closing and reopening the PR to see if that enables it to resync.

@creachadair creachadair reopened this Jul 15, 2020
Copy link
Owner Author

@creachadair creachadair left a comment

Choose a reason for hiding this comment

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

This PR seems to have lost track of its branch. I may need to re-create it.

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

Successfully merging this pull request may close these issues.

Support sequential request processing or selective request ordering
1 participant