-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Undisable ee9 BlockingTest and fix HttpChannel.produceContent #12529
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e510b69
Undisable ee9 BlockingTest and fix HttpChannel.produceContent
janbartel 222a272
Handle CoreContextRequest being null in produceContent/needContent
lorban 546cdd9
make tests non-flaky
lorban debb110
fix BlockingTest.testBlockingReadAndBlockingWriteGzipped hanging b/c …
lorban fe418fd
handle review comments
lorban 1a8c6f2
handle review comments
lorban 8e33d28
handle review comments
lorban f90f141
add temporary debugging stack trace
lorban 673391b
fix exception type
lorban c86a935
fix exception type
lorban bc191b5
remove leftover
lorban 4a149e9
do not recycle HttpStreamOverHttp1 when failed so that ChannelRequest…
lorban 9cfe2de
restore breaking the link between channel and stream
lorban 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
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.
@lorban is this reasonable?
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.
coreContextRequest
can only be null afterrecycle()
, so returning null in this case is wrong as that implies a call toneedContent()
should follow.I think returning an
new ErrorContent(new IllegalStateException("Illegal read from complete request"))
would be the right thing to do whencoreContextRequest
is null.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.
I don't see the difference between returning null here, and returning null at line 179 when there is no chunk?
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.
produceContent()
returning null has a special meaning: that means there's no content available right away, but more will follow, i.e.: everything is normal, there's just no content to be read right away. Error cases OTOH should always be returned in the form of anErrorContent
object.When
coreContextRequest
is null, this means the channel has been recycled, which is an error case.By the way, this
coreContextRequest
null check should also be done inneedContent()
as bothneedContent()
andproduceContent()
fulfill the same contract about the availability of content.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.
@lorban it's not possible to return
ErrorContent
forneedContent()
: you can returnfalse
or throw anException
, which would you prefer?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.
@janbartel as part of my commit, I changed
needContent()
to make it returntrue
whencoreContextRequest
is null.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.
@lorban are some of these tests racy? When I run
BlockingTest
inee9
andee88
locally on my machine, they all pass. When they run in CI,ee88
all fail with anIllegalStateException
due to the channel being recycled. See https://jenkins.webtide.net/blue/organizations/jenkins/jetty.project/detail/PR-12529/13/testsThere 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.
@janbartel Most of those tests were flaky, so I fixed them. But
testBlockingReadAndBlockingWriteGzipped()
was failing on a genuine bug inHttpChannelState.ChannelResponse
which I fixed too.But I would appreciate more pairs of eyes (@gregw? @sbordet?) to look at my fix as it's touching delicate code.