https://bz.apache.org/bugzilla/show_bug.cgi?id=66589

            Bug ID: 66589
           Summary: Data frame included in response for 200 OK status with
                    no body (content-length=0)
           Product: Tomcat 9
           Version: 9.0.x
          Hardware: Macintosh
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
          Assignee: dev@tomcat.apache.org
          Reporter: hypn...@donarproject.org
  Target Milestone: -----

Hi,

while investigating tomcat support for gRPC-servlet server, it seems that
tomcat is sending an empty data frame with end_stream flag uppon 200 status
response with no body (content-length=0).

This is not supported by gRPC:

https://github.com/grpc/grpc-java/blob/3c01bfe77f3d64d9ab97b28bc924105b3e72e8a7/servlet/src/tomcatTest/java/io/grpc/servlet/TomcatTransportTest.java#L254

https://github.com/grpc/grpc-java/blob/3c01bfe77f3d64d9ab97b28bc924105b3e72e8a7/core/src/main/java/io/grpc/internal/Http2ClientStreamTransportState.java#L150

Looking at the tomcat bug history, I came across
https://bz.apache.org/bugzilla/show_bug.cgi?id=66442. The fix
(https://github.com/apache/tomcat/commit/519403fb8aace2c64e1ee3999511719418dc6968)
only relies on the status code and not the content-length.

gRPC expects that only headers carry the end of stream flag from the server as
it never sends a data frame without a trailer frame.

Here is a possible fix :
https://github.com/hypnoce/tomcat/commit/27e6e3da7e5784b460da475a784d58f882fb1801

Let me know what you think.

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to