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

Support bidirectional streaming on websockets #1111

Merged
merged 27 commits into from
Aug 27, 2021

Conversation

niloc132
Copy link
Member

Fetch/h2-based grpc-web clients do not support bidirectional streaming at this time, but the websocket client we are using from https://github.com/improbable-eng/grpc-web/ does. This lets us keep a single websocket open instead of making many calls. The client has support now to abstract how a bidirectional stream is created, either by a single websocket, or by a pair of fetch calls.

Additionally, autocomplete was seeing problems that appeared related to the server-side grpc handling payloads out of order. These methods have been consolidated into a single bidirectional stream to ensure ordering is sane. The server now has support to only implement a bidirectional stream once, and mark the "open"/"next" rpc methods as part of that, and automatically have their requests enqueued to be handled serially.

Other improvements got slipped into this work as well, such as only interacting with autocomplete from the gRPC service and never from DB, so that dependency was cut (as well as the dependency on gRPC utils, which only existed to get jsr305 annotations into various projects).

The client is incomplete in this patch, we plan on continuing this work as part of #730.

Fixes #929
Fixes #834
Fixes #1049

@niloc132 niloc132 force-pushed the 834-websocket-bidi-streaming branch from d2cfc8a to 61791e7 Compare August 24, 2021 19:08
@niloc132 niloc132 force-pushed the 834-websocket-bidi-streaming branch from 61791e7 to da4e412 Compare August 24, 2021 19:09
 * lots of unsynchronized observers
 * grrrreat!
 * bad null check in browser stream
 * slim down some generics
@niloc132
Copy link
Member Author

James has pointed out that we need a mechanism to inform the client that individual requests for completion items have failed, without failing the stream. We also need a way to match requests and responses on the stream in case they race, and suppress CompletionCancelled errors from the log.

Copy link
Member

@JamesXNelson JamesXNelson left a comment

Choose a reason for hiding this comment

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

Overall looks good, only small issues.

A helper tag that will allow outstanding branches to merge from main with respect to the large style guide code application
JamesXNelson
JamesXNelson previously approved these changes Aug 26, 2021
nbauernfeind
nbauernfeind previously approved these changes Aug 26, 2021
@niloc132 niloc132 merged commit 51f19a5 into deephaven:main Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment