-
Notifications
You must be signed in to change notification settings - Fork 84
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
kotlin: grpc codec #472
kotlin: grpc codec #472
Conversation
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
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.
Looks good overall! Some comments
library/kotlin/src/io/envoyproxy/envoymobile/EnvoyStreamEmitter.kt
Outdated
Show resolved
Hide resolved
library/kotlin/src/io/envoyproxy/envoymobile/GRPCResponseHandler.kt
Outdated
Show resolved
Hide resolved
library/kotlin/src/io/envoyproxy/envoymobile/GRPCResponseHandler.kt
Outdated
Show resolved
Hide resolved
library/kotlin/test/io/envoyproxy/envoymobile/GRPCResponseHandlerTest.kt
Outdated
Show resolved
Hide resolved
library/kotlin/test/io/envoyproxy/envoymobile/GRPCStreamEmitterTest.kt
Outdated
Show resolved
Hide resolved
library/kotlin/src/io/envoyproxy/envoymobile/GRPCStreamEmitter.kt
Outdated
Show resolved
Hide resolved
2f66ef2
to
6842746
Compare
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
545a372
to
c492720
Compare
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
library/kotlin/src/io/envoyproxy/envoymobile/GRPCResponseHandler.kt
Outdated
Show resolved
Hide resolved
library/kotlin/src/io/envoyproxy/envoymobile/GRPCResponseHandler.kt
Outdated
Show resolved
Hide resolved
library/kotlin/src/io/envoyproxy/envoymobile/GRPCResponseHandler.kt
Outdated
Show resolved
Hide resolved
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.
Thanks for updating! Left another round of comments
library/kotlin/test/io/envoyproxy/envoymobile/GRPCStreamEmitterTest.kt
Outdated
Show resolved
Hide resolved
Adding a test to match Android (see [this comment](#472 (comment))) to validate that gRPC streams are closed with `nil` trailers, so as to force the stream to close with a data frame per the gRPC protocol spec. Signed-off-by: Michael Rebello <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
library/kotlin/test/io/envoyproxy/envoymobile/GRPCStreamEmitterTest.kt
Outdated
Show resolved
Hide resolved
Adding a test to match Android (see [this comment](#472 (comment))) to validate that gRPC streams are closed with `nil` trailers, so as to force the stream to close with a data frame per the gRPC protocol spec. Signed-off-by: Michael Rebello <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
Signed-off-by: Alan Chiu <[email protected]>
|
||
val byteArray = bufferedStream.toByteArray() | ||
val buffer = ByteBuffer.wrap(byteArray.sliceArray(1..4)) | ||
buffer.order(ByteOrder.BIG_ENDIAN) |
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.
Assuming the language does the right thing here and does the conversion to native format when you call .int
below this should be fine
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.
Yeah, it will write it in big endian here
Updates the Swift gRPC response compression error handling logic to match Android's: - Instead of silently failing, call `onError` in a terminal state and clear out other callbacks - Retain the `GRPCResponseHandler` while the core Envoy engine retains the underlying `onData` callback to ensure that error and message propogation can be called by the handler Context: #472 (comment) Signed-off-by: Michael Rebello <[email protected]>
Updates the Swift gRPC response compression error handling logic to match Android's: - Instead of silently failing, call `onError` in a terminal state and clear out other callbacks - Retain the `GRPCResponseHandler` while the core Envoy engine retains the underlying `onData` callback to ensure that error and message propogation can be called by the handler Context: #472 (comment) Signed-off-by: Michael Rebello <[email protected]>
Adding a test to match Android (see [this comment](envoyproxy/envoy-mobile#472 (comment))) to validate that gRPC streams are closed with `nil` trailers, so as to force the stream to close with a data frame per the gRPC protocol spec. Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
Updates the Swift gRPC response compression error handling logic to match Android's: - Instead of silently failing, call `onError` in a terminal state and clear out other callbacks - Retain the `GRPCResponseHandler` while the core Envoy engine retains the underlying `onData` callback to ensure that error and message propogation can be called by the handler Context: envoyproxy/envoy-mobile#472 (comment) Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
Adding a test to match Android (see [this comment](envoyproxy/envoy-mobile#472 (comment))) to validate that gRPC streams are closed with `nil` trailers, so as to force the stream to close with a data frame per the gRPC protocol spec. Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
Updates the Swift gRPC response compression error handling logic to match Android's: - Instead of silently failing, call `onError` in a terminal state and clear out other callbacks - Retain the `GRPCResponseHandler` while the core Envoy engine retains the underlying `onData` callback to ensure that error and message propogation can be called by the handler Context: envoyproxy/envoy-mobile#472 (comment) Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
gRPC codec for kotlin
We are able to hit an Envoy backed gRPC server from
lyft.com
We ran into some issues with testing (debug pull: #495). The first is outgoing ALPN is required for gRPC connections: #502. gRPC doesn't support disabling this option when starting up a service. We'll have to revisit this effort in the future.
For now, we are primarily missing #494 for local Envoy library e2e testing
Signed-off-by: Alan Chiu [email protected]
Description: gRPC codec for kotlin
Risk Level: low
Testing: unit/end-to-end
Docs Changes: n/a
Release Notes: n/a
[Optional Fixes #Issue]
[Optional Deprecated:]