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
Fixes #11016 - Jetty 12 IllegalStateException when stopping Server wi… #11017
Fixes #11016 - Jetty 12 IllegalStateException when stopping Server wi… #11017
Changes from 8 commits
dae910a
6c839f6
efee6f0
d93cba7
ac47524
586d57a
6377c57
ad46276
80c183c
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.
The boolean return was giving protection against calling this method twice.
So either, there is a possibility that we will call it twice, in which case we still need the protection....
OR we will never call it twice, so instead we should throw ISE if we are ever called with it is already in COMPLETED state.
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.
This method is only called once because it is protected by the
ServletChannel
state machine.From
ServletChannel.handle()
, we end up in theTERMINATED
state where we callonCompleted()
that calls this method.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.
So can we have an assert (or ISE) if it is already in COMPLETED state
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 sure what you refer to, as there are many COMPLETED states?
If you refer to
_outputState
it can also be ABORTED.I feel like we don't need this extra assert, as we just want to make the transition OPEN -> COMPLETED.
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.
This method used to return a boolean that indicated if it had just transitioned from OPEN->COMPLETED. If it returned false, then the callback would not be completed.
Now it returns a throwable to say if there has been a failure, in which case the callback is failed. But it has lost the protection for multiple calls, so the callback might be called twice.
I understand that you know this cannot happen because of external factors.... that nothing in this method represents that invariant. It would be clearer if it had something like:
If this assert does not hold, then this PR has changed behaviour in a non obvious way.