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
Create memhttp package to debug flaky testcases #594
Create memhttp package to debug flaky testcases #594
Changes from 17 commits
4c43e4b
1f1df5d
225aa0d
27410bd
facfa53
877b4df
932533f
c057a62
f6a2bd7
40594b7
b9fccc6
dd98dd4
716794b
ccd39d4
91afa1e
ea743b3
628915a
23dc2da
2ee0def
00d7f6a
758f889
fa4a554
7b062d1
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 change relevant? Why would the request data make this flaky or not?
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.
It causes the server to error with
invalid_argument: number must be positive: got 0
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.
Okay. But was that not true before? Why wasn't this a problem before this PR? (I'm trying to understand why change it now.)
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 test is checking in the interceptor that the peer address and peer protocol is set. It's testing each request style by sending an empty but valid request, however server stream is the only one that will cause the server handler to error. This can now report the server error instead of success. I don't think this is intended behaviour of the test.
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.
Not setting
Number
will cause the following only for grpcweb:Close
to fail withhttp2: response body closed
herediscard
which usually receives anio.EOF
The grpcweb error response is a header only response, need to investigate why this error is returned on a no body.
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.
Now flaky with:
Discard is reading from a closed response which is causing an
io.ErrClosedPipe
. This is probably due to the new memhttp. Need to investigate.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.
By "now", do you mean after the last commit you pushed, which removed calls to
response.Body.Close()
?Also, in that latest commit, who is the caller that is now responsible for calling
Close
? Is this done whenStreamClientConn.CloseResponse()
is called? Is there a chance some code path is failing to call that? (In particular, I'm suspicious why this would only happen for gRPC-Web and not others.)It seems like
discard
should be resilient againstio.ErrClosedPipe
and replace it withio.EOF
when observed, no?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.
It's due to the change in closing the pipe writer on Reader instead of Writer.
net.Pipe
will close both halves but the error is given on the opposite end. So closing the Reader made the Writer return niceio.EOF
errors but theReader
to receiveio.ErrClosedPipe
. HTTP2 libraries set the request error to the response hereI'll need to write more testing around closing, and create an issue for testing with different latencies.
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.
HTTP2 sets the error on the response then here
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.
Discard should never see
io.ErrClosedPipe
, however I've added context error checks to avoid issues with cancelation errors bubbling up toCloseResponse()
errors. These are tested inTestServer
tests.Working and passing with
-count=100
locally, can't see any more flaky test issues. Could you please re-review.