Skip to content

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

KTOR-6734 Upgrade Jetty to 12 #4887

wants to merge 1 commit into from

Conversation

bjhham
Copy link
Contributor

@bjhham bjhham commented May 28, 2025

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.

Copy link
Contributor

coderabbitai bot commented May 28, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@e5l e5l requested review from e5l and Copilot June 3, 2025 12:38
Copy link

@Copilot Copilot AI left a 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)
Copy link
Preview

Copilot AI Jun 4, 2025

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.

Suggested change
writeBuffer.write(value, length)
this.writeBuffer.write(value, length)

Copilot uses AI. Check for mistakes.

@bjhham bjhham force-pushed the bjhham/jetty-12-upgrade branch from 077cd17 to 7008e08 Compare June 10, 2025 08:48
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.

1 participant