-
Notifications
You must be signed in to change notification settings - Fork 927
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
Record the exception raised while serializing gRPC metadata #4625
Comments
Thanks for reporting the issue, @sfc-gh-nalekseev! |
I didn't have enough time to fix this bug. Let me handle it in the next iteration. 🙇♂️ |
FYI: I noticed that grpc/src/main/java/com/linecorp/armeria/server/grpc/ArmeriaServerCall.java is renamed to grpc/src/main/java/com/linecorp/armeria/server/grpc/AbstractServerCall.java As array size is preserved in the instance of io/grpc/ClientCall.java grpc/grpc-java@29d238a#diff-5ee94bb737d9714214695ecb38fb0307e2d997d90a05f2fed9082363e3086ceeR180
io/grpc/ServerCall.java
|
Right 👍 Let me share a little background on this change:
I would guess that we need to verify both unary and streaming implementations to check if the problem still persists.
I think |
I noticed just wrapping with I also noticed that finding root cause and reproducing the problem is a bit tough than I've expected.. Reason 1) The change of
has happened on It looks the error reported here could happen less than armeria-1.17.0. I'll read the code of armeria-1.16.1, and try to understand why the bug could happen. Reason 2) Because It would be the timing issue to reproduce the error. |
Thanks! I think we can create an invalid metadata using an unsafe API provided by gRPC.
Using this, I think we can throw a StatusRuntimeException including the
|
Partial fix for line#4625 . This fix sets 'RequestLog.request/responseCause()' only the case when Metadata was invalid. If we catch Exception at com.linecorp.armeria.server.grpc.StreamingServerCall#doClose and set them as new metadata, then they could be transferred to client side before timeout.
Partial fix for line#4625 . This fix sets 'RequestLog.request/responseCause()' only the case when Metadata was invalid. If we catch Exception at com.linecorp.armeria.server.grpc.StreamingServerCall#doClose and set them as new metadata, then they could be transferred to client side before timeout.
Partial fix for line#4625 . This fix sets 'RequestLog.request/responseCause()' only the case when Metadata was invalid. If we catch Exception at com.linecorp.armeria.server.grpc.StreamingServerCall#doClose and set them as new metadata, then they could be transferred to client side before timeout.
Partial fix for line#4625 . This fix sets 'RequestLog.request/responseCause()' only the case when Metadata was invalid. If we catch Exception at com.linecorp.armeria.server.grpc.StreamingServerCall#doClose and set them as new metadata, then they could be transferred to client side before timeout.
Partial fix for line#4625 . This fix sets 'RequestLog.request/responseCause()' only the case when Metadata was invalid. If we catch Exception at com.linecorp.armeria.server.grpc.StreamingServerCall#doClose and set them as new metadata, then they could be transferred to client side before timeout.
Partial fix for line#4625 . This fix sets 'RequestLog.request/responseCause()' only the case when Metadata was invalid. If we catch Exception at com.linecorp.armeria.server.grpc.StreamingServerCall#doClose and set them as new metadata, then they could be transferred to client side before timeout.
Motivation: I found an exception is thrown when "Armeria tries to set Metadata, but the Metadata is corrupted". Modifications: - Log an exception thrown while Armeria tries to set Metadata. - Returns the default `Metadata` with `INTERNAL` code instead as a fallback `Metadata`. Result: - Fixed `GrpcService` to return an INTERNAL error code if an error occurs while serializing gRPC metadata. - Closes #4625
Armeria currently doesn't catch and record the exception raised by
io.grpc.Metadata.serialize()
. As a result, when gRPC fails to serialize some metadata, the request will time out or fail silently. The exception should instead be recorded intoRequestLog.request/responseCause()
so a user can analyze the root cause more easily.Here's an example stack trace of such exceptions:
The text was updated successfully, but these errors were encountered: