Skip to content

servlet: tomcat does not support trailer only #10124

Open

Description

@hypnoce

gRPC version:
1.53.0
gRPC server transport: servlet
gRPC client transport: netty

What is your environment?

MacOS 12.4 jdk11

What did you expect to see?

This is a known behaviour where tomcat sends an empty data frame with a end_stream flag instead of a trailer only frame with end_stream flag. While it is a valid http2 behaviour, this is not supported by gRPC who expected end_stream frames to be sent in trailer or trailer-only frame.

What did you see instead?

Internal status error because a data frame is end_stream

Steps to reproduce the bug

The transport tests earlyServerClose_noServerHeaders, earlyServerClose_serverFailure and earlyServerClose_serverFailure_withClientCancelOnListenerClosed reproduce the problem

Activity

  1. added 15 commits that reference this issue on May 3, 2023
    9fa3e75
    c96be19
    0d0d716
    1cd5746
    a617e77
    abbf897
    a61ae5e
    492f610
    d7351ca
    c6f858b
    3f797f7
    7b79234
    f02f616
    f31de56
    4b0d14f
  2. 1 remaining item

  3. added a commit that references this issue on Aug 1, 2023
    63bb258
  4. added a commit that references this issue on Nov 23, 2023
    2eda56a
  5. added this to the 1.61 milestone on Dec 5, 2023
  6. modified the milestones: 1.61, 1.62 on Jan 11, 2024
  7. modified the milestones: 1.62, Next on Feb 6, 2024
  8. added 2 commits that reference this issue on Jun 3, 2024
    f2e72f9
    c066d9e
  9. added 4 commits that reference this issue on Jun 26, 2024
    033c895
    5a69eb7
    15542f9
    6713b8d
  10. mvazquezrius commented on Mar 31, 2025

    @mvazquezrius

    Are there plans on when this will be fixed?

  11. ejona86 commented on Nov 12, 2025

    @ejona86
    Member

    This is going to end up being closed as won't fix. In #12510 I talk about the problems with fixing Tomcat. I do agree Tomcat's behavior is valid, but it seems the only solution that would actually work is to change the clients, and there's simply not enough bandwidth to entertain that idea for the likes of Tomcat. If clients are fixed, then Tomcat's current behavior starts working, so there's really nothing to do on Tomcat in either case.

    If you really want to use Tomcat, and for some reason broken deadline handling doesn't bother you, you can use an interceptor like ForceTrailersServerInterceptor in #10125 and place it close to the application.

    Some docs will need to be added/updated to warn users, so I'm leaving this open until there's some hope a user would learn that Tomcat is unsupported before they rely on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions