Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-…
Browse files Browse the repository at this point in the history
…12255-dump-cookieconfig
  • Loading branch information
janbartel committed Sep 18, 2024
2 parents d990739 + dc43f3d commit 6bec4d8
Show file tree
Hide file tree
Showing 380 changed files with 1,066 additions and 1,865 deletions.
8 changes: 4 additions & 4 deletions .mvn/maven-build-cache-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<!-- activated via cli -->
<!-- to disable it just use -Dmaven.build.cache.enabled=false -->
<!--
-Dmaven.build.cache.remote.url=dav:http://nginx-cache-service.jenkins.svc.cluster.local:80 -Dmaven.build.cache.remote.enabled=true
-Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=remote-build-cache-server
-Dmaven.build.cache.remote.url=http://nexus-service.nexus.svc.cluster.local:8081/repository/maven-build-cache -Dmaven.build.cache.remote.enabled=true
-Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=nexus-cred
-->
<!-- <remote enabled="true" saveToRemote="true" id="remote-build-cache-server">-->
<!-- <url>dav:http://nginx-cache-service.jenkins.svc.cluster.local:80</url>-->
<!-- <remote enabled="true" saveToRemote="true" id="nexus-cred">-->
<!-- <url>http://nexus-service.nexus.svc.cluster.local:8081/repository/maven-build-cache</url>-->
<!-- </remote>-->
<multiModule>
<discovery>
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ def mavenBuild(jdk, cmdline, mvnName) {
buildCache = useBuildCache()
if (buildCache) {
echo "Using build cache"
extraArgs = " -Dmaven.build.cache.restoreGeneratedSources=false -Dmaven.build.cache.remote.url=http://nginx-cache-service.jenkins.svc.cluster.local:80 -Dmaven.build.cache.remote.enabled=true -Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=remote-build-cache-server -Daether.connector.http.supportWebDav=true "
extraArgs = " -Dmaven.build.cache.restoreGeneratedSources=false -Dmaven.build.cache.remote.url=http://nexus-service.nexus.svc.cluster.local:8081/repository/maven-build-cache -Dmaven.build.cache.remote.enabled=true -Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=nexus-cred "
} else {
// when not using cache
echo "Not using build cache"
extraArgs = " -Dmaven.test.failure.ignore=true -Dmaven.build.cache.skipCache=true -Dmaven.build.cache.remote.url=http://nginx-cache-service.jenkins.svc.cluster.local:80 -Dmaven.build.cache.remote.enabled=true -Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=remote-build-cache-server -Daether.connector.http.supportWebDav=true "
extraArgs = " -Dmaven.test.failure.ignore=true -Dmaven.build.cache.skipCache=true -Dmaven.build.cache.remote.url=http://nexus-service.nexus.svc.cluster.local:8081/repository/maven-build-cache -Dmaven.build.cache.remote.enabled=true -Dmaven.build.cache.remote.save.enabled=true -Dmaven.build.cache.remote.server.id=nexus-cred "
}
if (env.BRANCH_NAME ==~ /PR-\d+/) {
if (pullRequest.labels.contains("build-all-tests")) {
Expand Down
41 changes: 38 additions & 3 deletions VERSION.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
jetty-12.0.13-SNAPSHOT
jetty-12.0.14-SNAPSHOT

jetty-12.0.13 - 03 September 2024
+ 3184 Make LifeCycle implement AutoCloseable
+ 3553 Support sslSession() in Jetty Client
+ 6514 How to warm up SslConnection
+ 9121 Jetty 12 - Flaky
BlockedWritesWithSmallThreadPoolTest.testServerThreadsBlockedInWrites()
+ 11322 Change jetty-nosql MongoDB dependency from unmaintained
mongo-java-driver to mongodb-driver-sync
+ 11408 Jetty start module property values with ${expr} are not being expanded
+ 11434 resolve differences in EE9/EE10/Core AliasCheckerSymlinkTests
+ 11822 h2 server responses exceeding SETTINGS_MAX_HEADER_LIST_SIZE do not
result in RST_STREAM or GOAWAY
+ 11926 File upload puzzle
+ 12063 Introduce Jetty module for HTTP/2 client dependencies
+ 12094 Possible regression in ContextFactory.getObjectInstance() between
Jetty 11.0.22 and 12.0.11
+ 12104 Error handling on ee9 / ee8 with HTTP/1.0 can result in an empty
`Connection: ` response header.
+ 12120 Introduce properties for cipher suites
+ 12122 NPE in HttpReceiver.responseContentAvailable()
+ 12124 JSP temp directory regression, possibly due to fix for #12044
+ 12128 How do I configure embedded Jetty to serve webjars?
+ 12154 Is it possible to define max number of virtual threads when
VirtualThreadsExecutor is enabled, i.e. max number of http requests being
handled in the same time?
+ 12158 Jetty12 migration help
+ 12163 HttpConfiguration dump is missing entries
+ 12171 QoSHandler does not resume on a virtual thread
+ 12173 Jetty Maven Plugin - jetty:run does not work with pom type
dependencies
+ 12175 `SslContextFactory` is hardcoded to use `Password`.
+ 12185 QosHandler suspend queue limit
+ 12207 Jetty Maven Plugin 12.x no longer configures `DefaultHandler`
+ 12212 ShutdownOutput for non-persistent HTTP/1 connections

jetty-12.0.12 - 25 July 2024
+ 265 --list-config license enhancement
+ 265 list-config license enhancement
+ 10904 jetty.sh reports FAILED too early
+ 11965 Client: Some HTTP/2 requests are never sent
+ 11996 mTLS: client cert verification for QUIC/HTTP3
+ 12000 Cannot use Paths that have spaces with `jetty-ee10-maven-plugin`
+ 12000 Cannot use Paths that have spaces with `jetty-ee10-maven-plugin`
+ 12018 NPE when passing null value to Request.param
+ 12019 External property file not being read
+ 12022 Intermittent NPE in OutputStream.close with GzipHandler
Expand Down
2 changes: 1 addition & 1 deletion build/build-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-->
<groupId>org.eclipse.jetty</groupId>
<artifactId>build-resources</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Build :: Resources</name>

Expand Down
2 changes: 1 addition & 1 deletion build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-project</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.jetty.build</groupId>
<artifactId>build</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions build/scripts/release-jetty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ if [ ! -d "$ALT_DEPLOY_DIR" ] ; then
fi

# DEPLOY_OPTS="-Dmaven.test.failure.ignore=true"
DEPLOY_OPTS="-DskipTests -Dasciidoctor.skip=false -Dmaven.build.cache.enabled=false"
DEPLOY_OPTS="-DskipTests -Dasciidoctor.skip=false -Dmaven.build.cache.enabled=false -DdeployAtEnd=true -DretryFailedDeploymentCount=3 "
# DEPLOY_OPTS="$DEPLOY_OPTS -DaltDeploymentRepository=intarget::default::file://$ALT_DEPLOY_DIR/"

# Uncomment for Java 1.7
export MAVEN_OPTS="-Xmx4g"
export MAVEN_OPTS="-Xmx8g -Xms8g"

echo ""
echo "-----------------------------------------------"
Expand Down
2 changes: 1 addition & 1 deletion documentation/jetty/modules/code/examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.eclipse.jetty.documentation</groupId>
<artifactId>documentation</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
<relativePath>../../../../pom.xml</relativePath>
</parent>
<artifactId>code-examples</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

import java.util.concurrent.Executors;

import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP;
import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.util.thread.VirtualThreadPool;
Expand All @@ -26,9 +29,26 @@ public void queuedVirtualThreads()
{
// tag::queuedVirtual[]
QueuedThreadPool threadPool = new QueuedThreadPool();

// Simple, unlimited, virtual thread Executor.
threadPool.setVirtualThreadsExecutor(Executors.newVirtualThreadPerTaskExecutor());

// Configurable, bounded, virtual thread executor (preferred).
VirtualThreadPool virtualExecutor = new VirtualThreadPool();
virtualExecutor.setMaxThreads(128);
threadPool.setVirtualThreadsExecutor(virtualExecutor);

// For server-side usage.
Server server = new Server(threadPool);

// Simple client-side usage.
HttpClient client = new HttpClient();
client.setExecutor(threadPool);

// Client-side usage with explicit HttpClientTransport.
ClientConnector clientConnector = new ClientConnector();
clientConnector.setExecutor(threadPool);
HttpClient httpClient = new HttpClient(new HttpClientTransportOverHTTP(clientConnector));
// end::queuedVirtual[]
}

Expand All @@ -38,8 +58,21 @@ public void virtualVirtualThreads()
VirtualThreadPool threadPool = new VirtualThreadPool();
// Limit the max number of current virtual threads.
threadPool.setMaxThreads(200);
// Track, with details, virtual threads usage.
threadPool.setTracking(true);
threadPool.setDetailedDump(true);

// For server-side usage.
Server server = new Server(threadPool);

// Simple client-side usage.
HttpClient client = new HttpClient();
client.setExecutor(threadPool);

// Client-side usage with explicit HttpClientTransport.
ClientConnector clientConnector = new ClientConnector();
clientConnector.setExecutor(threadPool);
HttpClient httpClient = new HttpClient(new HttpClientTransportOverHTTP(clientConnector));
// end::virtualVirtual[]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,6 @@ See also the xref:server/index.adoc#threadpool[section about configuring the thr
The `threadpool-all-virtual` module allows you to configure the server-wide thread pool, similarly to what you can do with the <<threadpool,`threadpool`>> Jetty module, so that all threads are virtual threads, introduced as an official feature since Java 21.

CAUTION: Only use this module if you are using Java 21 or later.
If you are using Java 19 or Java 20, use the <<threadpool-virtual-preview,`threadpool-virtual-preview`>> Jetty module instead.

The module properties to configure the thread pool are:

Expand All @@ -724,17 +723,7 @@ include::{jetty-home}/modules/threadpool-all-virtual.mod[tags=documentation]

The property `jetty.threadpool.maxThreads` limits, using a `Semaphore`, the number of current virtual threads in use.

Limiting the number of current virtual threads helps to limit resource usage in applications, especially in case of load spikes.
When an unlimited number of virtual threads is allowed, the server might be brought down due to resource (typically memory) exhaustion.

[CAUTION]
====
Even when using virtual threads, Jetty uses non-blocking I/O, and dedicates a thread to each `java.nio.channels.Selector` to perform the `Selector.select()` operation.
Currently (up to Java 22), calling `Selector.select()` from a virtual thread pins the carrier thread.
When using the `threadpool-all-virtual` Jetty module, if you have `N` selectors, then `N` carrier threads will be pinned by the virtual threads calling `Selector.select()`, possibly making your system less efficient, and at worst locking up the entire system if there are no carrier threads available to run virtual threads.
====
Please refer to the xref:programming-guide:arch/threads.adoc#thread-pool-virtual-threads[virtual threads section] of the Jetty Threading Architecture for more information about virtual threads and their pitfalls.

[[threadpool-virtual]]
== Module `threadpool-virtual`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,35 @@ Defaulting the number of reserved threads to zero ensures that the <<execution-s
include::code:example$src/main/java/org/eclipse/jetty/docs/programming/ArchitectureDocs.java[tags=virtualVirtual]
----

Despite the name, `VirtualThreadPool` does not pool virtual threads, but allows you to impose a limit on the maximum number of current virtual threads, in order to limit resource consumption.
Despite the name, `VirtualThreadPool` does not pool virtual threads, but allows you to impose a limit on the maximum number of current virtual threads, using a `Semaphore`.

Furthermore, you can configure it to track virtual threads so that a xref:troubleshooting/component-dump.adoc[Jetty component dump] will show all virtual threads, including those that are unmounted.
Limiting the number of current virtual threads helps to limit resource usage in applications, especially in case of load spikes.
When an unlimited number of virtual threads is allowed, the server might be brought down due to resource (typically memory) exhaustion.

Furthermore, you can configure it to track virtual threads so that a xref:troubleshooting/component-dump.adoc[Jetty component dump] will show all virtual threads currently in use, including those that are unmounted.

[[thread-pool-virtual-threads-pinning]]
==== Virtual Threads Pinning

Even when using virtual threads, Jetty uses non-blocking I/O, and dedicates a thread to each `java.nio.channels.Selector` to perform the `Selector.select()` operation.

Currently (up to Java 22), calling `Selector.select()` from a virtual thread *pins* the carrier thread.

If you configure a server-side `Connector`, or Jetty's `HttpClient` with `N` selectors, then `N` carrier threads will be pinned by the virtual threads calling `Selector.select()`.

If you have less than `N` CPU cores in your system, then by default all carriers will be pinned in the `Selector.select()` call, leaving no carrier to execute virtual threads, and therefore completely locking up your system, which will become completely unresponsive.

If you have more than `N` CPU cores in your system, then by default your system may be less efficient, since the carrier threads may be pinned in the `Selector.select()` call, and therefore not available to run virtual threads.

[WARNING]
====
The number of CPU cores of your system determines, by default, the number of carrier threads.
The number of carrier threads may be explicitly configured by setting the system property `-Djdk.virtualThreadScheduler.parallelism=N`, where `N` is your desired number of carrier threads.
Selector threads used by Jetty pin carrier threads.
Choose the number of selectors wisely when using virtual threads: the number of selectors must always be less than the number of carrier threads, to leave some of the carrier threads free to run virtual threads.
As an extreme example, if your system only has `1` CPU core, then `1` selector is enough to pin the only carrier thread, and your system will eventually lock up.
In this case, you must explicitly configure the number of carrier threads by setting the system property `-Djdk.virtualThreadScheduler.parallelism=2` (or to a larger value).
====
2 changes: 1 addition & 1 deletion documentation/jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.eclipse.jetty.documentation</groupId>
<artifactId>documentation</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<artifactId>jetty</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion documentation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-project</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<groupId>org.eclipse.jetty.documentation</groupId>
<artifactId>documentation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion javadoc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-project</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<artifactId>javadoc</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion jetty-core/jetty-alpn/jetty-alpn-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<artifactId>jetty-alpn-client</artifactId>
<name>Core :: ALPN :: Client</name>
Expand Down
2 changes: 1 addition & 1 deletion jetty-core/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<artifactId>jetty-alpn-conscrypt-client</artifactId>
<name>Core :: ALPN :: Conscrypt Client</name>
Expand Down
2 changes: 1 addition & 1 deletion jetty-core/jetty-alpn/jetty-alpn-conscrypt-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<artifactId>jetty-alpn-conscrypt-server</artifactId>
<name>Core :: ALPN :: Conscrypt Server</name>
Expand Down
2 changes: 1 addition & 1 deletion jetty-core/jetty-alpn/jetty-alpn-java-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<artifactId>jetty-alpn-java-client</artifactId>
<name>Core :: ALPN :: Java Client</name>
Expand Down
2 changes: 1 addition & 1 deletion jetty-core/jetty-alpn/jetty-alpn-java-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<artifactId>jetty-alpn-java-server</artifactId>
<name>Core :: ALPN :: Java Server</name>
Expand Down
2 changes: 1 addition & 1 deletion jetty-core/jetty-alpn/jetty-alpn-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<artifactId>jetty-alpn-server</artifactId>
<name>Core :: ALPN :: Server</name>
Expand Down
2 changes: 1 addition & 1 deletion jetty-core/jetty-alpn/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-core</artifactId>
<version>12.0.13-SNAPSHOT</version>
<version>12.0.14-SNAPSHOT</version>
</parent>
<artifactId>jetty-alpn</artifactId>
<packaging>pom</packaging>
Expand Down
Loading

0 comments on commit 6bec4d8

Please sign in to comment.