Repository navigation
Conversation
|
|
c96be19 to
0d0d716
Compare
|
Hmm... this is a troublesome issue. We might want to fix support for trailers-only with a zero-length data frame following. For the short-term: nice job on this PR. I think it is pretty solid. But I'm not sure we want to go this way. I'm a hesitant to have the transport introduce the headers, because that is changing the RPC semantics and interceptors wouldn't react. A potentially easier workaround in terms of semantics and implementation would be "do this same approach in an interceptor." That way it can be positioned such that other interceptors could add headers if they need to. But it would require applications to use the interceptor. Thoughts? |
0d0d716 to
1cd5746
Compare
True. Now it changes a lot the control flows because we need to wait for the next data frame to ensure to handle headers as trailers if end_stream flag is set and this data frame is empty.
Thanks a lot :)
From what I understood from the gRPC flow, when writeTrailer is called with headerSent=false, that means that no headers were added by any interceptor. Also, some interceptors might decide to directly close the call without calling Now we could add an interceptor at the very beginning of the interceptors chain and implement the |
On server-side, everything looks normal. But on client-side headers appear and those were not seen on server-side. So client-side can then get confused (e.g., a key should have been in headers, but wasn't).
Yes, that is what I was suggesting. I think that should turn out to be really easy. |
1cd5746 to
a617e77
Compare
True, I get the point. The only weird case I can think of is that the client calls
@ejona86 I changed the PR to use a server interceptor. Obviously the transport level test do fail again but the interop tests do pass. Let me know what you think. Also, it cannot run before any global server interceptors. One final limitation are runtime exceptions. Handling them seems to be a bit tricky when not implemented at transport level. |
a61ae5e to
492f610
Compare
| import io.grpc.ServerInterceptor; | ||
| import io.grpc.Status; | ||
|
|
||
| class ForceTrailersServerInterceptor implements ServerInterceptor { |
There was a problem hiding this comment.
I had thought we'd allow the user to use this themselves. They may need to use it two or more times, between various interceptors.
There was a problem hiding this comment.
To be clear here, I thought we'd make this public (and so it'd also need an @ExperimentalApi annotation).
c6f858b to
3f797f7
Compare
| import io.grpc.ServerInterceptor; | ||
| import io.grpc.Status; | ||
|
|
||
| class ForceTrailersServerInterceptor implements ServerInterceptor { |
There was a problem hiding this comment.
To be clear here, I thought we'd make this public (and so it'd also need an @ExperimentalApi annotation).
4b0d14f to
63221e3
Compare
|
Just need to fix formatting of TomcatInteropTest: |
|
@ejona86 Sorry to ping you again. Where do you stand regarding this issue ? |
|
@ejona86 I put back the initial fix here: hypnoce@2eda56a |
5a69eb7 to
15542f9
Compare
…#10124) Signed-off-by: hypnoce <hypnoce@donarproject.org>
15542f9 to
6713b8d
Compare
|
@ejona86 Do you still think this PR can be merged ? We are maintaining a gRPC servlet fork on our side and going back to the mainstream gRPC would be a plus. Thanks ! |
|
up vote fo this PR |
|
Friendly ping for merge. It seems like this is both approved and passing. |
|
Hi there, stumbled over the issue a few days ago and finally found this fix. We applied it to our scenario and it seems to work just fine. Would you consider to merge hypnoce's fix so that we may use the servlet-based server? |
|
In my comments for this PR I kept talking about the interceptor, as that's the only safe approach to this problem on the server-side. However, that does nothing for deadlines which are really important, and so with #12510 I'm essentially giving up on Tomcat. I've written some in #10124 and #12510 about what's going on. This really needs a client-side fix, but Tomcat is simply not important enough for me to convince others to allow its valid behavior. I know this will disappoint people and there will be replies. Let's have those discussions in #10124; not here. |
Add option to force servlet transport to send trailers to avoid empty data frame with end_stream flag from servlet containers implementation (currently Tomcat).
fixes #10124