gRPC channels blocking indefinitely and not respecting deadlines on network disconnect#15983
Conversation
|
|
480182e to
f9b1856
Compare
|
|
|
|
|
|
|
|
|
yashykt
left a comment
There was a problem hiding this comment.
I've just got a few questions
There was a problem hiding this comment.
so.. run the closure immediately if there is an error (just thinking to myself).. though documentation might help
There was a problem hiding this comment.
shouldn't be needed right? remove_stream already has it
There was a problem hiding this comment.
Good observation, I've removed it.
There was a problem hiding this comment.
same here. remove_stream should run everything
There was a problem hiding this comment.
we don't need to check for stream_became_writable anymore?
There was a problem hiding this comment.
stream_became_writable is somewhat of a misnomer, it seems to mean a stream was unblocked by flow control for a message.
There was a problem hiding this comment.
I guess my question is - was it a mistake to be there earlier?
There was a problem hiding this comment.
Before grpc_chttp2_end_write would only have an effect for streams that were unblocked by flow control, so it wasn't an issue, just kind of a misnomer of writable.
Now we need to execute the new callback list, so we need to make sure it happens every time.
There was a problem hiding this comment.
hmm? but wait. this should again have the same problem. If we run the closures only on grpc_chttp2_begin_write, then it would only be called when there is another write or the previous write completed. Isn't it the same issue all over again?
There was a problem hiding this comment.
We flush the closures on both remove_stream and grpc_chttp2_end_write. In the cancellation case (the case that was broken before), remove_stream will be called, and that will take care of flushing the pending write ops.
There was a problem hiding this comment.
Added back this check. PTAL
There was a problem hiding this comment.
I'm guessing this is memset to zero and hence does not need to be inited
There was a problem hiding this comment.
I copied the pattern of the old per-transport run_after_write, and that one is not initialized either.
|
|
|
|
1 similar comment
|
|
1 similar comment
|
|
|
aecea1d to
66311d2
Compare
|
66311d2 to
f4c9151
Compare
|
|
|
|
|
d3949a5 to
5562dd5
Compare
|
|
|
|
|
…cting deadlines on network disconnect
Revert #15983 - gRPC channels blocking indefinitely and not respecting deadlines on network disconnect
The chttp2 transport would not execute write closures until a write occurred, even if the stream was cancelled.
This PR separates the write callback closure lists based on streams, so they can be run when a cancellation comes in.
Fixes #15889