-
Notifications
You must be signed in to change notification settings - Fork 183
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
NettyHttpServerTest.testErrorBeforeRead handle exception #1848
Conversation
Motivation: NettyHttpServerTest.testErrorBeforeRead has the server intentionally write an error without first consuming the request content. The server may close the connection before the client is done writting and if that is the case a ClosedChannelException may be observed and fail the test. Modifications: - Allow ClosedChannelException when making a request Result: Fixes apple#245
build failure attributed to #1579 |
Motivation: NettyHttpServerTest.testErrorBeforeRead has the server intentionally write an error without first consuming the request content. The server may close the connection before the client is done writting and if that is the case a ClosedChannelException may be observed and fail the test. Modifications: - Allow ClosedChannelException when making a request Result: Fixes #245
0.41 (a1fb483) |
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.
Interesting observation
} catch (Throwable cause) { | ||
// The server intentionally triggers an error when it writes, if this happens before all content is read | ||
// the client may fail to write the request due to premature connection closure. | ||
if (cause instanceof ExecutionException) { |
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.
Alternative approach can be to use "flushOnEnd" strategy by converting StreamingHttpRequest
to an aggregated one and back. Then we don't need to worry about write failures on the client-side.
This approach also good. Either way is great to fix this test.
Motivation:
NettyHttpServerTest.testErrorBeforeRead has the server intentionally
write an error without first consuming the request content. The server
may close the connection before the client is done writting and if that
is the case a ClosedChannelException may be observed and fail the test.
Modifications:
Result:
Fixes #245