Skip to content
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

Jetty 12 graceful contexts #9867

Merged
merged 11 commits into from
Jun 7, 2023
Merged

Jetty 12 graceful contexts #9867

merged 11 commits into from
Jun 7, 2023

Conversation

gregw
Copy link
Contributor

@gregw gregw commented Jun 4, 2023

@sbordet @lorban I was cleaning up TODO's in ContextHandler and saw that it didn't implement Graceful, so I looked at the GracefulHandler and saw that it had a bug, as it assumed a throw meant that the callback had not been called - thus a handler that completes the callback and then throws could be counted twice. Fixing that, I re-remembered the shortfalls of Callback, in that many of them are not truly atomic. So I was going to fix that just for GracefulHandler and ContextHandler, but then decided to do it for all the utility callbacks in Callback.java. I'm not 100% sold on this, but am wondering if there is actually any performance impact. @lorban can you run the perf tests on this branch to see?

If we don't like the extra atomics in Callback then we can just make a Callback.AtomicNested and use it where we think it is important. But if there is no significant performance impact, may as well use it everywhere... specially as I can add some debugging to help detect double calls.

gregw added 5 commits June 3, 2023 20:57
Improved semantics of Callbacks to facilitate correct nesting of callbacks
Signed-off-by: gregw <gregw@webtide.com>
@gregw gregw requested review from sbordet and lorban June 5, 2023 09:21
gregw added 2 commits June 5, 2023 16:57
Reverted most changes to Callback other than cleanups
Removed all shutdown mechanisms from ContextHandler
Reverted most changes to Callback other than cleanups
Removed all shutdown mechanisms from ContextHandler
@gregw gregw requested a review from sbordet June 5, 2023 15:13
@gregw gregw requested a review from lorban June 6, 2023 06:09
@gregw
Copy link
Contributor Author

gregw commented Jun 6, 2023

@lorban @sbordet This PR now removes Graceful from ContextHandler. It fixes the bug in GracefulHandler and adds a test of GracefulHandler with a ContextHandler. It also does some cleanup of Callback, but nothing revolutionary. Ready for re-review when green build again.

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@gregw gregw requested a review from sbordet June 6, 2023 21:12
@gregw gregw requested a review from lorban June 7, 2023 13:52
@gregw gregw merged commit c0de62b into jetty-12.0.x Jun 7, 2023
@gregw gregw deleted the jetty-12-graceful-contexts branch June 7, 2023 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants