-
Notifications
You must be signed in to change notification settings - Fork 1.1k
KTOR-6734 Upgrade Jetty to 12 #4887
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
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Pull Request Overview
This PR upgrades Jetty to version 12 in the Ktor server and client subsystems while adapting API changes and cleaning up deprecated servlet API dependencies. Key changes include updating import statements and class hierarchies (such as the new handler, call, and connection classes), reworking asynchronous error handling using the Callback interface, and adjusting dependency and build configuration files to reference the new Jetty 12 modules.
Reviewed Changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
JettyKtorHandler.kt | Updated handler signature and callback usage to match Jetty 12 APIs |
JettyHeaders.kt, JettyConnectionPoint.kt, JettyCallbacks.kt | Minor adjustments to reflect Jetty’s new API naming and types |
JettyApplicationCall.kt | Restructured application call implementation with inner request/response classes and updated websocket upgrade flow |
JettyApplicationEngineBase.kt, JettyApplicationEngine.kt | Changes to engine instantiation and connector extraction using QueuedThreadPool |
build.gradle.kts and libs.versions.toml | Updated dependency declarations to reference Jetty 12 and the new servlet modules |
ktor-io modules | Introduced a new overloaded writeBuffer function to support a length parameter |
JettyResponseListener.kt, JettyHttpRequest.kt, JettyEngineConfig.kt | Adjustments to client engine connection and HTTP/2 API usage as per Jetty 12 |
@@ -91,6 +91,12 @@ public suspend fun ByteWriteChannel.writeBuffer(source: RawSource) { | |||
writePacket(source.buffered()) | |||
} | |||
|
|||
@OptIn(InternalAPI::class) | |||
public suspend fun ByteWriteChannel.writeBuffer(value: RawSource, length: Long) { | |||
writeBuffer.write(value, length) |
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 invocation 'writeBuffer.write(value, length)' is ambiguous because it is not clear whether it refers to an internal buffer writer or might lead to unintended recursion. Consider clarifying the intent by explicitly referencing the appropriate function or object to improve readability and avoid potential bugs.
writeBuffer.write(value, length) | |
this.writeBuffer.write(value, length) |
Copilot uses AI. Check for mistakes.
077cd17
to
7008e08
Compare
Subsystem
Server, Jetty
Motivation
KTOR-6734 Jetty engine: Upgrade Jetty dependencies to the latest version 12
Solution
Just a quick little upgrade.
I've yet to work out websocket upgrades with the ee10 version of the Jetty 12 servlet wrapper engine. From what I understand, you now need to apply the upgrade as a servlet filter instead of calling it programmatically. I don't remember why I upgraded the servlet API implementation as well, maybe it was because the older one is now incompatible.