-
Notifications
You must be signed in to change notification settings - Fork 108
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4c43e4b
Debug flaky testcases with in memory network
emcfarlane 1f1df5d
Fix lint
emcfarlane 225aa0d
Add TODO for flaky test
emcfarlane 27410bd
Use local networking for benchmarks
emcfarlane facfa53
Merge branch 'main' into ed/memtest
emcfarlane 877b4df
Create memhttp and memhttp test packages
emcfarlane 932533f
Fix race on RegisterShutdown
emcfarlane c057a62
Fix transport desc
emcfarlane f6a2bd7
Fix feedback
emcfarlane 40594b7
Fix description
emcfarlane b9fccc6
Add Cleanup method test servers
emcfarlane dd98dd4
Revert moving options
emcfarlane 716794b
Ensure response errors are reported consistently
emcfarlane ccd39d4
Document BlockUntilResponseReady behaviour
emcfarlane 91afa1e
Ensure CloseWrite is called
emcfarlane ea743b3
Feedback remove changes to duplexHTTPCall
emcfarlane 628915a
Add comment to clarify behaviour
emcfarlane 23dc2da
Restrict log errors to New|Logger|Lshortfile
emcfarlane 2ee0def
Document response close error handling
emcfarlane 00d7f6a
Fix and document Close behaviour for pipe
emcfarlane 758f889
Move responseBodyReady to group what it protects
emcfarlane fa4a554
Add CloseResponse checks in TestServer
emcfarlane 7b062d1
Merge branch 'main' into ed/memtest
emcfarlane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.