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

Handle multiple requests for gRPC-Web #1187

Merged
merged 2 commits into from
May 24, 2021
Merged

Conversation

glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented May 19, 2021

Motivation:

Our gRPC Web implementation was somewhat underbaked. It would, for
example, disregard the 'connection' header and was not able to handle
multiple requests. That's pretty bad!

Modifications:

  • Rework part of the grpc-web state machine
  • Extend the http/2 to grpc state machine and codec to support multiple
    requests per instance
  • grpc-web state machine tests

Result:

gRPC Web is better tested and supports multiple requests.

@glbrntt glbrntt added the 🔨 semver/patch No public API change. label May 19, 2021
@glbrntt glbrntt requested a review from Lukasa May 19, 2021 14:58
Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

This seems like a really good clean-up George, nice one!

@glbrntt
Copy link
Collaborator Author

glbrntt commented May 20, 2021

CI failures are related to #1188

Motivation:

Our gRPC Web implementation was _somewhat_ underbaked. It would, for
example, disregard the 'connection' header and was not able to handle
multiple requests. That's pretty bad!

Modifications:

- Rework part of the grpc-web state machine
- Extend the http/2 to grpc state machine and codec to support multiple
  requests per instance
- grpc-web state machine tests

Result:

gRPC Web is better tested and supports multiple requests.
- setting state to 'notConfigured' meant that we weren't calling
  'finish' on the RPC handler
- calling 'finish' on the RPC handler is imporant: it breaks a retain
  cycle
- previously we 'finish'ed the handler on channel inactive, now we call
  it when both the request and the response streams have been closed.
Copy link
Collaborator

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Nice, LGTM.

@glbrntt glbrntt merged commit 1791c3e into grpc:main May 24, 2021
@glbrntt glbrntt deleted the gb-grpc-web branch May 24, 2021 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants