Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
server: respond correctly to client headers with END_STREAM flag set #3803
server: respond correctly to client headers with END_STREAM flag set #3803
Changes from 7 commits
ddfcffe
16540ed
8dee198
823ab91
b3675e1
c923ada
cb544ea
cd4c0fa
44f802d
7b5f2ab
8f6a20f
9ed72b9
7d2dbd3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this call not reliably failing now that we know it has sent the RST_STREAM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. It always returns with
err != nil
on the first call but sometimes it isio.EOF
and sometimes it is a cancelled error.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is
err
when this happens? Maybe we should change that? I'm guessing this is a race betweenRecv
returning before/after the illegal data frame is written.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
err
for this when logged reads asrpc error: code = Canceled desc = context canceled
. SometimesRecv
returns an err and sometimes the loop breaks because oferr == io.EOF
. That does sound like a race. Most of the timeRecv
returns the canceled desc err.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's test the actual error we expect to get from the stream here instead of "any error is fine".
I have a feeling it will be an RPC status error now, but maybe that's not right (#3575). We can just expect the wrong thing for now and leave a comment that it will need to be updated when #3575 is fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an error check here. The error is an RPC status error
Internal
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this synchronization you wouldn't see the RST_STREAM at all sometimes? That sounds wrong. The server should still send a RST_STREAM even after the stream is terminated on the server's side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the synchronization the handler would sometimes not encounter an error. I think this was because the goroutine for the test would finish before the goroutine for the handler would encounter an error condition.